summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <daniel.silverstone@codethink.co.uk>2018-05-30 17:15:04 +0100
committerDaniel Silverstone <daniel.silverstone@codethink.co.uk>2018-05-30 17:15:04 +0100
commit502fd53ac06b3f509eddbe5a9629066156659cd7 (patch)
treed805f7866452ab38000c7f2322a3ae9a8971a17e
parentf3781dc7a7b72f404702cc1e7d10d24c838a6696 (diff)
downloadcanopied-502fd53ac06b3f509eddbe5a9629066156659cd7.tar.bz2
3dp is enough for display purposes
-rw-r--r--src/definitions.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/definitions.rs b/src/definitions.rs
index 84703f9..0c79b6f 100644
--- a/src/definitions.rs
+++ b/src/definitions.rs
@@ -367,10 +367,10 @@ impl Units {
pub fn render(&self, unit: &str, value: QValue) -> String {
if let Some(idx) = self.all.get(unit) {
let scal = (value / self.qvals[*idx]).value();
- format!("{} {}", scal, self.raw[*idx].suffix)
+ format!("{:.3} {}", scal, self.raw[*idx].suffix)
} else {
// Unable to find the unit, so render rawish?
- format!("{} ({}?)", value.value(), unit)
+ format!("{:.3} ({}?)", value.value(), unit)
}
}
}