Skip to content

Commit

Permalink
Provide duration integration for Quantity[Seconds[1]]
Browse files Browse the repository at this point in the history
  • Loading branch information
propensive committed Mar 11, 2024
1 parent 828e08b commit 5880382
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/quantify.scala
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ object Quantitative extends Quantitative2:
erased given underlying[UnitsType <: Measure]: Underlying[Quantity[UnitsType], Double] = ###
erased given [UnitsType <: Measure]: CanEqual[Quantity[UnitsType], Quantity[UnitsType]] = ###

given genericDuration: GenericDuration[Quantity[Seconds[1]]] = quantity => (quantity/1000.0).toLong
given specificDuration: SpecificDuration[Quantity[Seconds[1]]] = long => Quantity(long*1000.0)

transparent inline given add[LeftType <: Measure, RightType <: Measure]
: AddOperator[Quantity[LeftType], Quantity[RightType]] =

Expand Down

0 comments on commit 5880382

Please sign in to comment.