From fe015b0227c6db7c2cdf3f6e83599a586a40c5ef Mon Sep 17 00:00:00 2001 From: CGQAQ Date: Sun, 25 Aug 2019 23:30:00 +0800 Subject: [PATCH] fix number may exceed 1024 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复网速可能超过1024的问题,比如1500 Byte 应该是 1.x KB --- v2rayN/v2rayN/Forms/MainForm.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/v2rayN/v2rayN/Forms/MainForm.cs b/v2rayN/v2rayN/Forms/MainForm.cs index 63bc559a..6d3b3cbe 100644 --- a/v2rayN/v2rayN/Forms/MainForm.cs +++ b/v2rayN/v2rayN/Forms/MainForm.cs @@ -57,14 +57,15 @@ namespace v2rayN.Forms { double up_amount = 0.0, down_amount; string up_unit = "", down_unit; + + up /= (ulong)(config.statisticsFreshRate / 1000f); + down /= (ulong)(config.statisticsFreshRate / 1000f); + Utils.ToHumanReadable(up, out up_amount, out up_unit); Utils.ToHumanReadable(down, out down_amount, out down_unit); up_unit += "/s"; down_unit += "/s"; - up_amount /= config.statisticsFreshRate / 1000f; - down_amount /= config.statisticsFreshRate / 1000f; - toolSslBlank4.Text = string.Format( "{4}: {0:f2} {1} | {5}: {2:f2} {3}", up_amount,