Ruby Units
Posted by tom January 6th, 2008
While we’re at it here’s also a little info about the brilliant gem “ruby-units”, which takes away all the nasty conversion from you.
It can be easily installed using the known:
gem install ruby-unitsHere’s some sample code:
require 'rubygems'
gem 'ruby-units'
require 'ruby-units'
c = Unit.new("100cm") >> "ft"
puts c.scalar
k = Unit.new("100","kg") >> "lbs"
puts k.scalar

Sorry, comments are closed for this article.