How do I print:
print(f"\nTotal amount inserted: ${total_money}")
So that total money will display to 2 decimal places?
How do I print:
print(f"\nTotal amount inserted: ${total_money}")
So that total money will display to 2 decimal places?
You should specify the number of decimal places with the N
in {num:.Nf}
.
For example:
>>> print(f'{2:.2f}')
2.00