Open demilsson opened 1 year ago
I'm trying to set up a converter between the inverse units m/s and min/km (meters per second -> minutes per kilometer).
m/s
min/km
meters per second
minutes per kilometer
Using simple syntax, this works as expected and provides the correct result:
let qty = new Qty('1.9054 m/s'); let result = qty.to('min/km'); // result = 8.7470697316399
However, the same conversion using swiftConverter throws an error instead:
swiftConverter
let qty = Qty.swiftConverter('m/s', 'min/km'); let result = qty(1.9054); // Throws QtyError: Incompatible units: m/s and min/km
Why can't the swiftConverter do the same conversion? It works for other, non-inverse conversions, so I guess the problem lies somewhere in there.
I use swiftConverter since my application converts hundreds of arrays with thousands of values. Is there a way to work around this?
I'm trying to set up a converter between the inverse units
m/s
andmin/km
(meters per second
->minutes per kilometer
).Using simple syntax, this works as expected and provides the correct result:
However, the same conversion using
swiftConverter
throws an error instead:Why can't the
swiftConverter
do the same conversion? It works for other, non-inverse conversions, so I guess the problem lies somewhere in there.I use
swiftConverter
since my application converts hundreds of arrays with thousands of values. Is there a way to work around this?