Skip to content

flutter-cavalry/pretty_bytes

Repository files navigation

pretty_bytes

pub package Build Status

Dart port of pretty-bytes.

Usage

import 'package:pretty_bytes/pretty_bytes.dart';

void main() {
  print(prettyBytes(5000));
  // 5 KB

  print(prettyBytes(5000, signed: true));
  // +5 KB

  print(prettyBytes(5000, bits: true));
  // 5 Kbit

  print(prettyBytes(1025, binary: true));
  // 1 KiB

  print(prettyBytes(0.4, locale: 'de'));
  // 0,4 B
}

About

Convert bytes to a human readable string

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages