Q:

Calculation with derived units (e.g. 1 hour * 1 miles/hour)

I have been trying to make a calculation with derived units, so far I have not got anywhere.
I have tried mathjs, but if I type 1 hour * 1 miles/hour, I get UnsupportedTypeError: Function divide(unit, unit) not supported.
Can it be true that there really is no library for calculating with derived units?
Example of how it should work: 5 hour * 2 miles/hour = 10 miles

A:

Actually, js-quantities can solve your problem, as long as you use the syntax of the framework:
Qty('5 hour').mul(Qty('2 miles/hour')).toString()

returns
"10 mi"

