micro library that provides an easy way to get human readable file size strings
- size can be passed as number or as string
- optional parameter to specify numbers after comma/point
- optional parameter to use the decimal system for calculation
- Petabyte support :D
filesize(1024); // "1 KB"
filesize(664365320); // "633.59 MB"
filesize(4324324232343); // "3.93 TB"Optional parameter to specify numbers after comma/point:
filesize(664365320, 4); // "633.5881 MB"
filesize(4324324232343, 3); // "3.932 TB"and to use the decimal system for calculation, e.g. 1000B = 1KB:
filesize(664365320, 4, true); // "664.3653 MB"
filesize(4324324232343, 3, true); // "4.324 TB"filesize.dart is inspired by filesize.js
filesize.dart is licensed under BSD-3