Skip to content

erdbeerschnitzel/filesize.dart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

filesize.dart

micro library that provides an easy way to get human readable file size strings

Features

  • 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

Examples

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"

Information

filesize.dart is inspired by filesize.js

License

filesize.dart is licensed under BSD-3

About

micro library that provides an easy way to get human readable file size strings

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages