Crates.io | frequency-unit |
lib.rs | frequency-unit |
version | 0.2.3 |
source | src |
created_at | 2024-06-23 10:13:43.196378 |
updated_at | 2024-10-07 12:30:42.187591 |
description | A library for interacting with units of frequency. |
homepage | https://gitee.com/zr233/frequency-unit |
repository | https://gitee.com/zr233/frequency-unit |
max_upload_size | |
id | 1281114 |
size | 8,554 |
A library for interaction with units of frequency.
let freq = Frequency::from_mhz(1.0);
let freq2 = Frequency::from_mhz(2.0);
let freq3 = freq + freq2;
let a: f64 = freq3.to_mhz();
assert_eq!(a, 3.0);
let freq = Frequency::from_mhz(12.3456789);
assert_eq!(format!("{:<10.2}", freq), "12.35 MHz");