Hello,
How do I print 10,000,000 with the commas in CircuitPython? My searches points me to Pyhon using {:,} in the .format line, but CircuitPython doesn't support that.
Bruce
{:,} print number with commas every 1,000
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_carter
- Posts: 29150
- Joined: Tue Nov 29, 2016 2:45 pm
Re: {:,} print number with commas every 1,000
What board and version of CircuitPython are you using?
Code: Select all
Adafruit CircuitPython 7.3.3 on 2022-08-29; Adafruit QT Py RP2040 with rp2040
>>> "{:,}".format(10000000)
'10,000,000'
>>>
- blakebr
- Posts: 956
- Joined: Tue Apr 17, 2012 6:23 pm
Re: {:,} print number with commas every 1,000
Carter,
It works. I thought I tried that. I must have fat-fingered something.
Thank you,
Bruce
It works. I thought I tried that. I must have fat-fingered something.
Thank you,
Bruce
Please be positive and constructive with your questions and comments.