data_size 0.2.0 copy "data_size: ^0.2.0" to clipboard
data_size: ^0.2.0 copied to clipboard

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

🔟 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"
3
likes
150
points
4.19k
downloads

Publisher

verified publisherwanke.dev

Weekly Downloads

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

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

meta

More

Packages that depend on data_size