def to_s(unit = nil, precision = 0)
      if unit.to_s =~ /_and_/
        units = unit.to_s.split('_and_').map do |unit|
          self.class.fetch_scale(unit)
        end
        
        UnitGroup.new(units).format(@amount, precision)
      else
        unit = self.class.fetch_scale(unit)
        unit.format(@amount, precision)
      end
    end
def to_s(unit = nil, precision = 0)
      if unit.to_s =~ /_and_/
        units = unit.to_s.split('_and_').map do |unit|
          self.class.fetch_scale(unit)
        end
        
        UnitGroup.new(units).format(@amount, precision)
      else
        unit = self.class.fetch_scale(unit)
        unit.format(@amount, precision)
      end
    end
Format the measurement and return as a string.
 This will format using the base unit if no unit
 is specified.

 Example:

   Length.new(1.8034).to_s(:feet) => 6'

 Multiple units can be specified allowing for a
 more naturally formatted measurement. For example:

   Length.new(1.8034).to_s(:feet_and_inches) => 5' 11"

 Naturally formatted measurements can be returned using
 shorthand functions:

   Length.new(1.8034).in_feet_and_inches => 5' 11"

 The unit group can also be specified to get a similar effect:

   Length.new(1.8034).to_s(:metric) => '1m 80cm 3mm'

 A precision can be specified, otherwise the measurement
 is rounded to the nearest integer.