SkillAgentSearch skills...

Filesize.dart

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

Install / Use

/learn @erdbeerschnitzel/Filesize.dart
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

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

View on GitHub
GitHub Stars6
CategoryDevelopment
Updated5y ago
Forks16

Languages

Dart

Security Score

55/100

Audited on Jan 11, 2021

No findings