You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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 toNumeric to also trigger the simplification. I can get to this myself next week, or you can submit a PR yourself if it is urgent.
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
outputs
The text was updated successfully, but these errors were encountered: