diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-02-17 12:14:50 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-02-17 12:14:50 +0100 |
| commit | c7a9bac99224af9673f26ec140af48e1728fe3b5 (patch) | |
| tree | c7611385e8f0245b69e1e8cb24d36d2689808528 /src/geom/mod.rs | |
| parent | ab95627d873239182e7b28b266f8b9f9da5cdbb1 (diff) | |
Better debug implementations for numeric types
Diffstat (limited to 'src/geom/mod.rs')
| -rw-r--r-- | src/geom/mod.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/geom/mod.rs b/src/geom/mod.rs index a03e88b0..1a48534c 100644 --- a/src/geom/mod.rs +++ b/src/geom/mod.rs @@ -59,3 +59,8 @@ pub trait Get<Index> { *self.get_mut(index) = component; } } + +/// Round a float to two decimal places. +fn round_2(value: f64) -> f64 { + (value * 100.0).round() / 100.0 +} |
