gentooboontoo / js-quantities

JavaScript library for quantity calculation and unit conversion
http://gentooboontoo.github.io/js-quantities/
MIT License
396 stars 103 forks source link

Conversion of compound units gives wrong result #106

Open shrdlu9-lab opened 4 years ago

shrdlu9-lab commented 4 years ago

I noticed that converting some compound units from SI/US produces wrong results. Here is an example with mass per area:

var qty = new Qty(657.5, 'kg/m^2'); qty.to('lb/sqft');

This results in 1449.54lbs/sqft. The correct result would be 134.6lbs/sqft.

Other examples include a unit of enthalpy 'kJ/m^2' converted to 'BTU/sqft'. I assume this is due to wrong grouping: is there another way I can write the units so it will work?