byte_converter 1.3.0 copy "byte_converter: ^1.3.0" to clipboard
byte_converter: ^1.3.0 copied to clipboard

Provides a simple interface for conversion of Digital values such as Bytes, KiloBytes etc.

example/byte_converter_example.dart

import 'package:byte_converter/byte_converter.dart';

void main() {
  // ignore: omit_local_variable_types
  double bytes = 100000;

  // ignore: omit_local_variable_types
  ByteConverter converter = ByteConverter(bytes);
  print('$bytes bytes is ${converter.kiloBytes} Kb');
  print('$bytes bytes is ${converter.megaBytes} Mb');
  print('$bytes bytes is ${converter.gigaBytes} Gb');
  print('$bytes bytes is ${converter.teraBytes} Tb');

  // or

  // ignore: omit_local_variable_types
  double gigaByte = 70.5;
  converter = ByteConverter.fromGigaBytes(gigaByte);
  print('$bytes bytes is ${converter.kiloBytes} Kb');
  print('$bytes bytes is ${converter.megaBytes} Mb');
  print('$bytes bytes is ${converter.gigaBytes} Gb');
  print('$bytes bytes is ${converter.teraBytes} Tb');
}
6
likes
140
points
2.1k
downloads

Publisher

verified publisherarunprakashg.com

Weekly Downloads

Provides a simple interface for conversion of Digital values such as Bytes, KiloBytes etc.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

More

Packages that depend on byte_converter