summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/src/angle.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/src/angle.rs b/core/src/angle.rs
index 9c8a9b24..0882ae80 100644
--- a/core/src/angle.rs
+++ b/core/src/angle.rs
@@ -1,6 +1,7 @@
use crate::{Point, Rectangle, Vector};
use std::f32::consts::{FRAC_PI_2, PI};
+use std::fmt::Display;
use std::ops::{Add, AddAssign, Div, Mul, RangeInclusive, Rem, Sub, SubAssign};
/// Degrees
@@ -237,3 +238,9 @@ impl PartialOrd<f32> for Radians {
self.0.partial_cmp(other)
}
}
+
+impl Display for Radians {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ write!(f, "{} rad", self.0)
+ }
+}