format_thousands
Template filter to format a number so that it's thousands are separated by commas. {{ number|format_thousands }}
- format
- string
- comma
- decimal
- number
- thousands
- float
Template filter to format a number so that it's thousands are separated by commas. {{ number|format_thousands }}
Converts an integer or floating-point number or a string to a string containing the delimiter character (default comma) after every delimeter_count digits (by default 3 digits)
Simple DecimalField class extension that automatically adds formatting and validation for comma-separated "decimals". Works wonderfully for price fields. Could be extended to strip dollar signs or to be locale-agnostic.