We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
ruby (2.1.2) ruby-units (1.4.5)
2.1.2 :019 > Unit("1 mm") >> 'cm' => 1/10 cm 2.1.2 :020 > Unit("1.0 mm") >> 'cm' => 1/10 cm 2.1.2 :021 > Unit("1.1 mm") >> 'cm' => 0.11 cm 2.1.2 :022 > Unit("11 mm") >> 'cm' => 11/10 cm 2.1.2 :023 > Unit("111 mm") >> 'cm' => 111/10 cm
The result sometimes became rational. How can I force it not to be rational?
The text was updated successfully, but these errors were encountered:
the version you are using uses rational numbers internally to avoid rounding problems. Why do you want to force it to not be a rational?
Sorry, something went wrong.
I have the same issue.
2.0.0p247 :030 > unit = Unit('1 oz') >> 'g' => 45359237/1600000 g
I would much rather get 28.3495231 g (at least for decimal units).
2.0.0p247 :040 > unit.scalar.to_f => 28.349523125
Any thoughts?
I am also seeing
2.0.0p247 :058 > Unit.new('1 1/2 oz') => 3/2 oz
Correct but now very user friendly, can you offer me any advise?
No branches or pull requests
ruby (2.1.2)
ruby-units (1.4.5)
The result sometimes became rational. How can I force it not to be rational?
The text was updated successfully, but these errors were encountered: