diff --git a/Sources/Units/Units.swift b/Sources/Units/Units.swift index 4e705cd..c748c40 100644 --- a/Sources/Units/Units.swift +++ b/Sources/Units/Units.swift @@ -383,6 +383,23 @@ public struct UnitValue: (lhs.value * rhs.value)[lhs.unit] } + /// The result will have the `unit` of the left hand side value. + public static func * ( + lhs: UnitValue, rhs: R + ) + -> UnitValue + { + (lhs.value * rhs.doubleValue)[lhs.unit] + } + + public static func * ( + lhs: L, rhs: UnitValue + ) + -> UnitValue + { + (lhs.doubleValue * rhs.value)[rhs.unit] + } + /// The result will have the `unit` of the left hand side value. public static func / ( lhs: UnitValue, rhs: UnitValue