ByteConverter
instancebytes
: The number of bytes to be converted.
use data_storage_units::ByteConverter;
let converter = ByteConverter::new(1024);
A tuple containing the value in kilobytes as f64
and the unit “KB”.
let converter = ByteConverter::new(1024);
let (value, unit) = converter.to_kb();
A tuple containing the value in megabytes as f64
and the unit “MB”.
let converter = ByteConverter::new(1073741824);
let (value, unit) = converter.to_mb();
A tuple containing the value in gigabytes as f64
and the unit “GB”.
let converter = ByteConverter::new(1073741824);
/let (value, unit) = converter.to_gb();
A tuple containing the value in terabytes as f64
and the unit “TB”.
let converter = ByteConverter::new(1073741824);
let (value, unit) = converter.to_tb();