By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,470 Members | 994 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,470 IT Pros & Developers. It's quick & easy.

How to format a numeric Entry with commas (,) in Python

P: 1
Am using Python 3.7 when a user enters a number, he expects to see the figure displayed in the entry field with commas.

eg 3755125.70 to be displayed as 3,755,125.70. Is it possible?
3 Weeks Ago #1
Share this Question
Share on Google+
1 Reply


100+
P: 110
Expand|Select|Wrap|Line Numbers
  1. f = float(input())
  2. print('{:,}'.format(f))
3 Weeks Ago #2

Post your reply

Sign in to post your reply or Sign up for a free account.