Format unit output using formatting codes
‘%0.2f’ % ‘1 mm’.to_unit => ‘1.00 mm’
Parameters:
Returns:
22 23 24 25 26 27 28
# File 'lib/ruby_units/string.rb', line 22 def %(*other) if other.first.is_a?(RubyUnits::Unit) other.first.to_s(self) else super end end