Measurement: don't use SI prefix if there's no unit
This commit is contained in:
@@ -76,7 +76,11 @@ impl Measurement {
|
||||
use MeasurementValue::*;
|
||||
match self.value {
|
||||
Field(v) => format!("{}{}", v, self.unit),
|
||||
Float(f) => SiScale::format_short(f, &self.unit),
|
||||
Float(f) => if self.unit != "" {
|
||||
SiScale::format_short(f, &self.unit)
|
||||
} else {
|
||||
f.to_string()
|
||||
},
|
||||
Int(u) => format!("{}{}", u, self.unit),
|
||||
Dim(v) => format!("{}x{}x{}{}", v.x(), v.y(), v.z(), self.unit),
|
||||
}
|
||||
|
Reference in New Issue
Block a user