require 'bigdecimal'nm = "0.123456789012345678901234567890123456789"nm.to_f # => 0.123456789012346BigDecimal(nm).to_s # => "0.123456789012345678901234567890123456789E0"