Mathjs: Suggestion: use thousands of kilometres instead of "megameters" by default

Created on 25 Mar 2019  路  4Comments  路  Source: josdejong/mathjs

At present:

1001 km = 1.001 Mm //megameters

I understand why MathJS evaluates the expression this way, given the standard SI prefix system for metric units.

However, scientists & regular people are much more likely to use thousands of kilometers than megameters. It would be nice if MathJS could make a practical exception from jumping to the next largest SI unit in this case.

feature

Most helpful comment

Yes that's true, we don't use megameters in practice. Makes sense to me to make a special rule for this in the function that finds the "best" prefix.

I'm thinking about whether there are other units which have a similar case. Maybe time in seconds? (I don't use megaseconds but I do use milliseconds for example?). More ideas?

All 4 comments

Yes that's true, we don't use megameters in practice. Makes sense to me to make a special rule for this in the function that finds the "best" prefix.

I'm thinking about whether there are other units which have a similar case. Maybe time in seconds? (I don't use megaseconds but I do use milliseconds for example?). More ideas?

Also:

1001 kg = 1.001 Mg

Implementing #1314 would be nice and could address this issue as well :)

Also:

1001 kg = 1.001 Mg

In most contexts (scientific, civil engineering, except perhaps for astronomy and particle physics), I would expect that to be communicated as 1.001 t tonnes (metric tons).

The km versus Mm issue is resolved by UnitMath's commonPrefixes property for each unit, m in this case.

Choosing between kg and t is a little more subjective in my opinion, it could go either way. Possibly we could include a method that converts a unit to a different related unit of a more appropriate magnitude, but I don't think we would be able to meet everyone's expectations perfectly.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

skgadi picture skgadi  路  4Comments

SamuelMarks picture SamuelMarks  路  3Comments

balagge picture balagge  路  5Comments

comex picture comex  路  5Comments

piotr-s-brainhub picture piotr-s-brainhub  路  3Comments