Rename Measurement::scalar to Measurement::base_scalar
Opened this issue · 0 comments
turboladen commented
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.