lib/quantify/quantity.rb
# Converts a quantity to the equivalent quantity using only SI units
Converts a quantity to the equivalent quantity using only SI units
Converts a quantity to the equivalent quantity using only SI units
def to_si
      if @unit.is_compound_unit?
        Quantity.new(@value,@unit).convert_compound_unit_to_si!
      elsif @unit.is_dimensionless?
        return self.clone
      elsif @value.nil?
        return Quantity.new(nil, @unit.si_unit)
      else
        self.to(@unit.si_unit)
      end
    end
def to_si if @unit . is_compound_unit? Quantity . new ( @value , @unit ) . convert_compound_unit_to_si! elsif @unit . is_dimensionless? return self . clone elsif @value . nil? return Quantity . new ( nil , @unit . si_unit ) else self . to ( @unit . si_unit ) end end
Converts a quantity to the equivalent quantity using only SI units
Converts a quantity to the equivalent quantity using only SI units