js-quantities
js-quantities copied to clipboard
"pt" is an alias for both "point" and "pint"
See https://github.com/olbrich/ruby-units/issues/35
I disagree about the fix made in ruby-units (removal of pt as abbreviation of point). pt is commonly used with font sizes and CSS. I would like to keep the both and disambiguate them through a global setting representing an optional context like typography or cooking for instance. Depending on it, pt would be parsed as pint or point.
There should definitely be some way to know what 'pt' is going to become before it is used. Right now it depends on the order of the internal UNITS declaration and looping which is not good.
If alias support was added, it would be easy to add a set of 'cooking' aliases or 'typography' aliases. These aliases can override any default aliases, like for 'time' purposes 'm' could become 'minutes' rather than 'meters'.
Ruby-units does allow for aliasing and therefore removing 'pt' as an abbreviation for 'point' shouldn't be an issue for them as you can change it programmatically.