Fix size formatting

This commit is contained in:
Matéo Duparc 2021-12-20 20:24:07 +01:00
parent bd4c935c4c
commit 7ca9398766
Signed by: hardcoresushi
GPG Key ID: 007F84120107191E
1 changed files with 2 additions and 2 deletions

View File

@ -89,8 +89,8 @@ object PathUtils {
if (size <= 0) {
return "0 B"
}
val digitGroups = (log10(size.toDouble()) / log10(1024.0)).toInt()
return DecimalFormat("#,##0.#").format(size / 1024.0.pow(digitGroups.toDouble())
val digitGroups = (log10(size.toDouble()) / log10(1000.0)).toInt()
return DecimalFormat("#,##0.#").format(size / 1000.0.pow(digitGroups.toDouble())
) + " " + units[digitGroups]
}