Float number Precision
puts '%.2f' % 123.456 # '123.46': two digits after decimal place puts '%.2e' % 123.456 # '1.23e+02': two digits after decimal = three significant digits puts '%.6e' % 123.456 # '1.234560e+02': note added zero puts '%.4g' % 123.456 # '123.5': four significant digits