Selaa lähdekoodia

remove prefix letter from constant

ashilkn 2 vuotta sitten
vanhempi
commit
c885abd893
1 muutettua tiedostoa jossa 4 lisäystä ja 4 poistoa
  1. 4 4
      lib/utils/data_util.dart

+ 4 - 4
lib/utils/data_util.dart

@@ -8,15 +8,15 @@ double convertBytesToGBs(final int bytes, {int precision = 2}) {
   );
 }
 
-final kStorageUnits = ["bytes", "KB", "MB", "GB"];
+final storageUnits = ["bytes", "KB", "MB", "GB"];
 
 String convertBytesToReadableFormat(int bytes) {
   int storageUnitIndex = 0;
-  while (bytes >= 1024 && storageUnitIndex < kStorageUnits.length - 1) {
+  while (bytes >= 1024 && storageUnitIndex < storageUnits.length - 1) {
     storageUnitIndex++;
     bytes = (bytes / 1024).round();
   }
-  return bytes.toString() + " " + kStorageUnits[storageUnitIndex];
+  return bytes.toString() + " " + storageUnits[storageUnitIndex];
 }
 
 String formatBytes(int bytes, [int decimals = 2]) {
@@ -24,5 +24,5 @@ String formatBytes(int bytes, [int decimals = 2]) {
   const k = 1024;
   final int dm = decimals < 0 ? 0 : decimals;
   final int i = (log(bytes) / log(k)).floor();
-  return ((bytes / pow(k, i)).toStringAsFixed(dm)) + ' ' + kStorageUnits[i];
+  return ((bytes / pow(k, i)).toStringAsFixed(dm)) + ' ' + storageUnits[i];
 }