Commit 9b2671d5 authored by Mygod's avatar Mygod

Refine traffic format

parent f728a676
......@@ -26,13 +26,13 @@
app:min="1"
app:max="65535"
android:key="remotePortNum"
app:summary="@string/remote_port_summary"
android:summary="@string/remote_port_summary"
android:title="@string/remote_port"/>
<com.github.shadowsocks.preferences.NumberPickerPreference
app:min="1025"
app:max="65535"
android:key="localPortNum"
app:summary="@string/port_summary"
android:summary="@string/port_summary"
android:title="@string/port"/>
<com.github.shadowsocks.preferences.PasswordEditTextPreference
android:inputType="textPassword"
......@@ -43,7 +43,7 @@
android:key="encMethod"
app:entries="@array/enc_method_entry"
app:entryValues="@array/enc_method_value"
app:summary="%s"
android:summary="%s"
android:title="@string/enc_method"/>
<SwitchPreference
android:key="isAuth"
......@@ -59,7 +59,7 @@
android:key="route"
app:entries="@array/route_entry"
app:entryValues="@array/route_value"
app:summary="%s"
android:summary="%s"
android:title="@string/route_list"/>
<SwitchPreference
android:key="isIpv6"
......
......@@ -27,11 +27,11 @@ object TrafficMonitor {
}
private val units = Array("KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB", "BB", "NB", "DB", "CB")
private val numberFormat = new DecimalFormat("0.00")
private val numberFormat = new DecimalFormat("@@@")
def formatTraffic(size: Long): String = {
var n: Double = size
var i = -1
while (n >= 1024) {
while (n >= 1000) {
n /= 1024
i = i + 1
}
......@@ -52,8 +52,8 @@ object TrafficMonitor {
}
def update(tx: Long, rx: Long) {
txTotal = tx;
rxTotal = rx;
txTotal = tx
rxTotal = rx
}
def reset() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment