Floating Point and Exponential Notation Output : float format « Data Type « Python Tutorial






print '%f' % 1234.567890
print '%.2f' % 1234.567890
print '%E' % 1234.567890
print '%e' % 1234.567890
print '%g' % 1234.567890
print '%G' % 1234.567890
print "%e" % (1111111111111111111111L)








2.5.float format
2.5.1.formatting float number, use the f specifier and supply the precision as a . (dot) followed by the number of decimals
2.5.2.Formatting Numbers
2.5.3.Floating Point and Exponential Notation Output
2.5.4.format float numbers