from tinytab import fmt_number
fmt_number(1234567.891)'1,234,567.89'
Format a number with a fixed number of decimal places and a thousands separator.
Usage
x: floatThe number to format.
decimals: int = 2The number of decimal places.
sep_mark: str = "," strBy default, numbers get two decimal places and a comma between groups of thousands:
Use decimals= to change the precision, and sep_mark= for a different separator: