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

Rename Measurement::scalar to Measurement::base_scalar #12

Open
turboladen opened this issue Dec 3, 2020 · 0 comments
Open

Rename Measurement::scalar to Measurement::base_scalar #12

turboladen opened this issue Dec 3, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@turboladen
Copy link
Contributor

Right now the call to scalar returns a float value of the measurement in terms of its base unit (ex. "1 km"'s scalar -> "1000.0"); this contradicts the behavior in js-quantities though, where scalar() returns the value of the measurement and baseScalar() returns the value in terms of the base unit.

After thinking about it a bit, it seems like scalar probably isn't used for much from the public API sense--it's primarily used when doing math on two compatible measurements or converting one measurement to another compatible unit type (we have to reduce down to that base units to do any of that). I think that just renaming scalar to base_scalar should clarify the API a bit.

@turboladen turboladen added the enhancement New feature or request label Dec 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant