-1

How do I print:

print(f"\nTotal amount inserted: ${total_money}")

So that total money will display to 2 decimal places?

1 Answers1

0

You should specify the number of decimal places with the N in {num:.Nf}. For example:

>>> print(f'{2:.2f}')
2.00
Mohammad Jafari
  • 1,742
  • 13
  • 17