QUERY · ISSUE
f-string thousands separator doesn't work with floats
bugpy-core
On v1.19.1, f-string thousands separator doesn't work with floats. Tested on both unix and rp2040:
Demo code:
foo_int = 123456
foo_float = 1234.56789
print(f"{foo_int:,} {foo_float:,}")
CPython (correct):
123,456 1,234.56789
MicroPython (incorrect):
123,456 1234.57
CANDIDATE · PULL REQUEST
f-string thousands separator for float
py-core
Summary
Closes #11284
thousand separator was not implemented for floating point number
Testing
test the thousand separator for different float
test that the rounding up with the thousand separator (esp : 9,999.99 rounded to 10,000.0)
couldn't test that no buffer overflow occurs when using the thousand separator