yummies/format
Description
Namespace-style number, percent, and string formatting for UI tables, inputs, and charts. Submodules cover locale-aware numbers, percent parsing/formatting, trimming helpers, and shared constants so presentation rules stay centralized and tree-shakable behind the package aggregated format export from this entry point.
Usage
import { format } from "yummies/format";format.NO_VALUE
Placeholder shown when a formatter cannot produce a meaningful value.
Examples:
const fallback = NO_VALUE;format.number(null, { emptyText: NO_VALUE });format.HYPHEN
Plain ASCII hyphen character.
Examples:
const separator = HYPHEN;`foo${HYPHEN}bar`;format.INFINITY
Infinity symbol used by numeric formatters and UI output.
Examples:
const label = INFINITY;`${INFINITY} items`;format.NumberFormatSettings
No description.
format.number()
Formats a numeric value with thousands separators, fractional digit control and optional postfix text.
Invalid, empty or unsupported values fall back to emptyText.
Examples:
number(12000); // '12 000'number(12.5, { digits: 1, postfix: '%' }); // '12.5%'format.PercentFormatSettings
No description.
format.percent()
Formats a value as a percent string with configurable decimal precision, decimal divider and suffix symbol.
Examples:
percent(12.345); // '12.35%'percent(12.345, { divider: ',', symbol: ' pct' }); // '12,35 pct'format.skipSpaces()
Removes all whitespace characters from a string.
Examples:
skipSpaces('1 000 000'); // '1000000'skipSpaces('a\tb\nc'); // 'abc'