diff --git a/core/src/angle.rs b/core/src/angle.rs index 9c8a9b2448..0882ae8007 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 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) + } +}