Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Unit's .toNumeric() incorrect immediately after calculation with mixed units #901
When doing calculations with mixed units, such as multiplying feet and meters, .toNumeric() returns an incorrect value immediately after the calculation. Once .formatUnits() has been called on the result, .toNumeric() returns the correct value.
An example at http://jsbin.com/wusavigugi/edit?html,js,output shows that
Thanks for reporting. It seems like this is due to the lazy simplification of units. Combining and simplifying all the units accrued during an operation is costly, so we only do it at the end when the unit is formatted as a string. Perhaps we should alter