byte_converter 1.2.0
byte_converter: ^1.2.0 copied to clipboard

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

ByteConverter #

available on Pub

Provides a simple interface for conversion of Digital values such as Bytes, KiloBytes etc. This library is a based on ByteSize library available on C# dotnet platforms which i am a huge fan off.

Created from templates made available by Stagehand under a BSD-style license.

Usage #

A simple usage example:

import 'package:byte_converter/byte_converter.dart';

main() {
  double bytes = 100000;

  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

  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');
}

License #

This project is licensed under MIT License. Read about it here: MIT License

Features and bugs #

Please file feature requests and bugs here issue tracker.

0
likes
90
pub points
22%
popularity

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

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

arun.prakash.456789@gmail.com

License

MIT (LICENSE)

More

Packages that depend on byte_converter