/** * Framework-agnostic number DISPLAY formatting. * * Pure helpers for rendering plain numeric values and ratios as strings, with a * deterministic `en-GB` fallback locale so output is machine-stable regardless * of the host OS locale - the same principle as the money and date seams. * * It is pure - no React, no host access - so it lives in core-utils behind the * `@ethisyscore/core-utils/number` sub-path. */ /** * Deterministic fallback locale. Matches the money/date seams so numbers render * consistently when no explicit locale is supplied, and so output does not drift * with the OS locale of whatever host renders it. */ declare const NUMBER_FALLBACK_LOCALE = "en-GB"; /** * Formats a numeric value with grouping and a fixed number of decimal places via * `Intl.NumberFormat`. Returns an em-dash (`"—"`) for null/undefined so an * absent value renders as a readable placeholder rather than `"NaN"` or `"null"`. * * Defaults to two decimal places in {@link NUMBER_FALLBACK_LOCALE}. */ declare function formatNumber(value: number | null | undefined, options?: { decimalPlaces?: number; locale?: string; }): string; /** * Formats a RATIO as a percentage string with a fixed number of decimal places - * e.g. `0.1234` -> `"12.34%"`. The input is a ratio, not an already-scaled * percentage. * * Uses `toFixed` (no grouping) rather than `Intl` percent style so output is a * plain fixed-decimal percentage, matching what callers expect on compact labels. * Defaults to two decimal places. */ declare function formatPercent(ratio: number, options?: { decimalPlaces?: number; }): string; export { NUMBER_FALLBACK_LOCALE, formatNumber, formatPercent };