Formatting Numbers: float : Output Format « Development « Python
- Python
- Development
- Output Format
Formatting Numbers: float
print "Today's stock price: %f" % 50.4625
print "Today's stock price: %.2f" % 50.4625
print "Change since yesterday: %+.2f" % 1.5
Related examples in the same category