Expand description
Display-time number formatting: digit grouping (thousands separators), decimal separator choice, and optional fixed float precision.
This is display-only. Exports, queries, filter values, views, and
group-by key strings always use raw values — see format_any_value call
sites. Nothing here is ever fed back into Polars.
§Performance
Formatting runs once per visible cell per frame (roughly
visible_rows * visible_cols), so the hot path is deliberately allocation
free beyond the destination String the caller already needs:
- Integers are written digit-by-digit into a stack buffer with separators emitted inline — one pass, no intermediate string.
NumberFormat::width_i64computes display width arithmetically, so the locked-column measurement pass never builds a string it throws away.- Per-column decisions (dtype eligibility, exclude globs) resolve to a
CellFormatteronce per column per frame, never per cell.
Structs§
- Glob
- Minimal glob matcher supporting
*(any run) and?(one character). - Number
Format - How numbers are rendered. Resolved from config once at load time.
- Number
Format Settings - Fully resolved display-formatting settings, held in the render context.
Enums§
- Cell
Formatter - Per-column formatting decision, resolved once per column per frame.
- Grouping
- Digit grouping style.
Functions§
- display_
width - Cells a value takes on screen without building its string, where possible.
- format_
any_ value - Format one Polars value for display.
- group_
chrome - Comma-group a count for the application’s own chrome — the control bar’s row count, info-panel totals, and similar labels.
- is_
numeric_ dtype - True for dtypes whose values are numbers we group.
- is_
right_ aligned_ dtype - True for dtypes that should render flush-right in the data table.
- preset_
for_ locale_ tag - Map a POSIX locale / language tag to the preset whose conventions match.
- system_
locale_ tag - Read the environment’s numeric locale, honouring POSIX precedence.
Returns
Nonewhen unset or explicitly the C/POSIX locale.