Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are the scalar and baseScalar properties public? #36

Open
n-e opened this issue Feb 21, 2015 · 2 comments
Open

Are the scalar and baseScalar properties public? #36

n-e opened this issue Feb 21, 2015 · 2 comments
Labels

Comments

@n-e
Copy link

n-e commented Feb 21, 2015

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.

@nakedible-p
Copy link

I have the exact same question, are they public? Can I trust them to stay, or must I use q('10km').div('m').toFloat()?

@rage-shadowman
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants