Browse Source

fixed 0 bytes will not show up, and, corrected function name

tags/3.0
kimw 8 years ago
parent
commit
6f38bbb1d3
2 changed files with 4 additions and 3 deletions
  1. +2
    -2
      shadowsocks-csharp/Util/Util.cs
  2. +2
    -1
      shadowsocks-csharp/View/LogForm.cs

+ 2
- 2
shadowsocks-csharp/Util/Util.cs View File

@@ -98,7 +98,7 @@ namespace Shadowsocks.Util
}
}
public static string FormatBandwide(long n)
public static string FormatBandwidth(long n)
{
float f = n;
string unit = "B";
@@ -122,7 +122,7 @@ namespace Shadowsocks.Util
f = f / 1024;
unit = "TiB";
}
return $"{f:.##}{unit}";
return $"{f:0.##}{unit}";
}
[DllImport("kernel32.dll")]


+ 2
- 1
shadowsocks-csharp/View/LogForm.cs View File

@@ -109,7 +109,8 @@ namespace Shadowsocks.View
lastOffset = reader.BaseStream.Position;
}
this.Text = $"Log Viewer [in: {Utils.FormatBandwide(controller.inboundCounter)}, out: {Utils.FormatBandwide(controller.outboundCounter)}]";
this.Text = I18N.GetString("Log Viewer") +
$" [in: {Utils.FormatBandwidth(controller.inboundCounter)}, out: {Utils.FormatBandwidth(controller.outboundCounter)}]";
}
private void LogForm_Load(object sender, EventArgs e)


Loading…
Cancel
Save