From 5bc39755918f15e71f0fb4507672eb106b910add Mon Sep 17 00:00:00 2001 From: kr328 Date: Mon, 11 Apr 2022 20:48:09 +0800 Subject: [PATCH] Fix: fix traffic format --- .../main/java/com/github/kr328/clash/core/util/Traffic.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/github/kr328/clash/core/util/Traffic.kt b/core/src/main/java/com/github/kr328/clash/core/util/Traffic.kt index 895f6f08..050eb506 100644 --- a/core/src/main/java/com/github/kr328/clash/core/util/Traffic.kt +++ b/core/src/main/java/com/github/kr328/clash/core/util/Traffic.kt @@ -22,17 +22,17 @@ private fun trafficString(scaled: Long): String { scaled > 1024 * 1024 * 1024 * 100L -> { val data = scaled / 1024 / 1024 / 1024 - "${data / 100}.${data % 100} GiB" + String.format("%.2f GiB", data.toFloat() / 100) } scaled > 1024 * 1024 * 100L -> { val data = scaled / 1024 / 1024 - "${data / 100}.${data % 100} MiB" + String.format("%.2f MiB", data.toFloat() / 100) } scaled > 1024 * 100L -> { val data = scaled / 1024 - "${data / 100}.${data % 100} KiB" + String.format("%.2f KiB", data.toFloat() / 100) } else -> { "$scaled Bytes"