thermostat/src/units.rs

11 lines
228 B
Rust
Raw Normal View History

2020-05-17 06:13:52 +08:00
use core::fmt;
#[derive(Debug, Clone, PartialEq, PartialOrd)]
pub struct Volts(pub f64);
impl fmt::Display for Volts {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{:.3}V", self.0)
}
}