js-quantities
js-quantities copied to clipboard
Are the scalar and baseScalar properties public?
Hi,
The scalar and baseScalar properties aren't documented in the README.md, though there's a mention in a toFloat exception:
> q('10km').toFloat();
Error: Can't convert to Float unless unitless. Use Unit#scalar`
Are theses properties public? If so the documentation might need to be updated.
I have the exact same question, are they public? Can I trust them to stay, or must I use q('10km').div('m').toFloat()?
I always used the scalar member directly, so personally, I consider it part of the public api. And the error message seems to confirm this. But it may be better to have a getScalar function so that we keep the user from modifying it directly.