Skip to main content

Module format

Module format 

Source
Expand description

Formatting utilities for values and unit expressions.

Consolidates numeric and unit formatting helpers that are used across the CLI, LSP, and internal evaluation pipeline.

Functionsยง

format_exponent
Render a unit/dimension exponent suffix: ^2 for integers, ^(1/2) for rationals (the parenthesized form is re-parseable).
format_number
format_unit_expr
Format a UnitExpr as a human-readable label. E.g., m, km/hour, kg * m / s^2
format_unit_expr_canonical
Format a UnitExpr in canonical normalized form for display labels.
format_unit_expr_with_config
Format a UnitExpr as a human-readable label. E.g., m, km/hour, kg * m / s^2