mirror of
https://github.com/python/cpython
synced 2026-11-06 09:02:40 +03:00
5 lines
143 B
Python
5 lines
143 B
Python
import locale
|
|
|
|
|
|
def fmt(value: int | float, decimals: int = 1) -> str:
|
|
return locale.format_string(f'%.{decimals}f', value, grouping=True)
|