3 unstable releases
0.2.0 | Feb 25, 2025 |
---|---|
0.1.1 | Feb 25, 2025 |
0.1.0 | Dec 11, 2024 |
#14 in #measure
267 downloads per month
5KB
80 lines
Conv(e)rt
Rust library for easy conversion between measures
== Documentation ==
To read the library documentation run cargo doc
or browse the online docs at https://docs.rs/convrt
lib.rs
:
Utils for converting between different measures
Example
use convrt::Size;
let s = Size::from_bytes(1024);
assert_eq!(s.as_kibibytes(), 1);
assert_eq!(s.as_kilobytes(), 1);
assert_eq!(s.as_kibibytes_f64(), 1.0);
assert!(s.as_kilobytes_f64() > 1.0);