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
Math.js doesn't support prefixes for all unit types. Therefore, units like [kBTU/hour] cannot be used. Seems like Math.js only supports prefixes for SI units. Another solution would be to support multiplication factors in unit definitions such as [1000*BTU/hour].
The text was updated successfully, but these errors were encountered:
mathjs allows for definitions of units that includes prefixes as needed. For units like BTU that already exists, you need to override the unit with a definition from another unit (as the override removes the unit as a first step).
Thanks for the suggestion. Yes, your suggestion would work, though I'm hesitant to pull the maintenance of the unit conversion factors into this project since it's not just BTU that's impacted. Most units in mathjs don't support prefixes so that would require overriding quite a few units.
Another possibility that also works is to include variables in the mathjs parser like stating that kBTU = 1000 BTU then when you evaluate 10 kBTU implicit multiplication would make the correct unit in BTU and you would make a division to convert back to the unit you need.
Nonetheless, I think it would be lees work with createUnit but certainly more risk.
Math.js doesn't support prefixes for all unit types. Therefore, units like [kBTU/hour] cannot be used. Seems like Math.js only supports prefixes for SI units. Another solution would be to support multiplication factors in unit definitions such as [1000*BTU/hour].
The text was updated successfully, but these errors were encountered: