Skip to content
This repository has been archived by the owner on May 7, 2023. It is now read-only.

synw/filesize

 
 

Repository files navigation

Filesize

pub package Build Status Coverage Status

A 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 of digits after comma/point

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"

Inspired by filesize.js

About

Humanize file sizes

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Dart 100.0%