Unit Converter for Rust Language
This library allows you to convert a size in bytes into kilobytes, megabytes, gigabytes, and terabytes, as well as perform conversions back to bytes.
Create a new ByteConverter instance
bytes: The number of bytes to be converted.
use ByteConverter;
let converter = new;
Converts bytes to kilobytes (KB)
A tuple containing the value in kilobytes as f64 and the unit "KB".
let converter = new;
let = converter.to_kb;
Converts bytes to megabytes (MB)
A tuple containing the value in megabytes as f64 and the unit "MB".
let converter = new;
let = converter.to_mb;
Converts bytes to gigabytes (GB)
A tuple containing the value in gigabytes as f64 and the unit "GB".
let converter = new;
/let = converter.to_gb;
Converts bytes to terabytes (TB)
A tuple containing the value in terabytes as f64 and the unit "TB".
let converter = new;
let = converter.to_tb;