Closed thegedge closed 7 years ago
Added additional tests. I also realized, which I should have earlier, that we to_f
for Rational
output when the denominator isn't 1. This means that pluralizing doesn't read as well (e.g., "1/8 fireball" vs "0.125 fireballs").
Will switch the merge base and rebase on master once unit-improvements
(https://github.com/Shopify/measured/pull/74) reviewed and merged.
After merging https://github.com/Shopify/measured/pull/72,
Unit#to_s
now shows its conversion whento_s
-ing aMeasurable
. This is almost always undesirable for presentation, so we should instead just show the unit name.Since we depend on
ActiveSupport
I've also added a#humanize
method that can pluralize the unit name if the value isn't unity.