Computer Studies‎ > ‎Python‎ > ‎References‎ > ‎

Printing Dollars Demo

Here's a technique for printing dollars with the correct number of decimal places:

dollars = 2.4

print ('$' + format(dollars,'.2f'))
Comments