safe-units icon indicating copy to clipboard operation
safe-units copied to clipboard

value in an unit

Open raoz opened this issue 3 years ago • 2 comments

Hello!

Would appreciate an escape-hatch to get the value in a particular unit, e.g.

Measure.of(8, furlongs).valueIn(miles) returns numeric 1.

raoz avatar Apr 28 '21 17:04 raoz

Hi @raoz,

This is possible right now via:

Measure.of(8, furlongs).over(miles).value

Does this solve your use case?

jscheiny avatar Apr 29 '21 12:04 jscheiny

Hi @jscheiny,

Thanks, this does solve it for now, might make a pull request soon to add the valueIn sugar for clarity, if you don't mind.

raoz avatar Apr 30 '21 08:04 raoz