Function const_units::conversion_factor
source · pub fn conversion_factor<V, const SCALE: (i128, u128)>() -> Quantity<V, { _ }>Expand description
Create a conversion factor
Used to cancel out the scale factor without changing the underlying value
// Returns a `Quantity`
assert_eq!(conversion_factor::<f64, { (1, 60) }>(), Quantity::<f64, { DIMENSIONLESS.scale_by((1, 60)) }>(60.));
// Converting minutes to seconds
assert_eq!(Quantity::<f64, { minute }>(1.) * conversion_factor::<f64, { (1, 60) }>(), Quantity::<f64, { second }>(60.))