Skip to content

🔟 Customizable data size (bit & byte) formatting for interfacing with the user

License

Notifications You must be signed in to change notification settings

JonasWanke/data_size

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔟 Customizable data size (bit & byte) formatting for interfacing with the user

Build, Test & Lint Coverage

Features

  • format DataUnit.bit and DataUnit.byte
  • select a prefix:
    • Prefix.decimal (kB, MB, … with multiples of 1000)
    • Prefix.binary (KiB, MiB, … with multiples of 1024)
  • select a precision (number of decimal places)

Examples

final defaultString = 12345.formatByteSize();                     // "12.35 kB"
final noDecimalPlaces = 12345.formatByteSize(precision: 0);       // "12 kB"
final binaryPrefix = 12345.formatByteSize(prefix: Prefix.binary); // "12.06 KiB"
final bits = 12345.formatBitSize();                               // "12.35 kb"

About

🔟 Customizable data size (bit & byte) formatting for interfacing with the user

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages