feat: add size display

This commit is contained in:
Simon Ding
2024-08-07 13:06:37 +08:00
parent 1390277b43
commit 78ab8cc8e6
2 changed files with 14 additions and 7 deletions

View File

@@ -45,7 +45,7 @@ class Utils {
}
extension FileFormatter on num {
String readableFileSize({bool base1024 = true}) {
String readableFileSize({bool base1024 = false}) {
final base = base1024 ? 1024 : 1000;
if (this <= 0) return "0";
final units = ["B", "kB", "MB", "GB", "TB"];