Python Forum
tip calculator not displaying proper dollar format
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
tip calculator not displaying proper dollar format
#3
Use:
print('To tip 20% the amount is: $ {:.2f}'.format(tip20))
Another way is to use [url=https://docs.python.org/3/library/functions.html#round]round[/url].

print('To tip 20% the amount is: $',round(tip20,2))
Reply


Messages In This Thread
RE: tip calculator not displaying proper dollar format - by hbknjr - Aug-30-2017, 08:36 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Histogram using pandas dataframe not showing proper output ift38375 1 2,273 Jul-04-2019, 10:43 PM
Last Post: scidam

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020