/** * Options shared by the human-facing display formatters. * * @public */ export interface FormatOptions { /** Fixed number of decimal places. Defaults are per-formatter. */ decimals?: number; /** Rendered when the value is null/undefined/NaN/non-finite. Defaults to `'—'`. */ placeholder?: string; /** BCP 47 locale controlling digit grouping and separators (e.g. `'en-US'`). */ locale?: string; } type FormatInput = number | string | null | undefined; /** * Format a USD value, unsigned: `$1,234.50`, `-$1,500.00`, `$0.00`. * * Two decimal places with locale digit grouping. Negatives place the `-` * before the `$`. Null/undefined/non-finite input renders the placeholder. * * @public */ export declare function formatUsd(value: FormatInput, options?: FormatOptions): string; /** * Format a USD value with an explicit sign: `+$1.43`, `-$1.43`, `$0.00`. * * The sign is derived after rounding, so sub-cent magnitudes render `$0.00` * (no spurious `+`/`-`). Null/undefined/non-finite input renders the * placeholder. * * @public */ export declare function formatSignedUsd(value: FormatInput, options?: FormatOptions): string; /** * Format a percentage with an explicit sign and no grouping: `+1.43%`, * `-1.43%`, `0.00%`. * * The sign is derived after rounding, so sub-threshold magnitudes render * `0.00%`. Null/undefined/non-finite input renders the placeholder. * * @public */ export declare function formatSignedPercent(value: FormatInput, options?: FormatOptions): string; /** * Format a price, unsigned, with decimals auto-detected from magnitude: * `$1,234.50`, `$0.1234`, `-$1,500.00`. * * Decimals follow {@link autoDecimals} unless `options.decimals` is given. * Grouping applies once the absolute value reaches 1000. Negatives place the * `-` before the `$`. Null/undefined/non-finite input renders the placeholder. * * @public */ export declare function formatPrice(value: FormatInput, options?: FormatOptions): string; /** * Format a USD value compactly with a `B`/`M`/`K` suffix: `$1.23B`, `$45.6M`, * `$789.0K`, `$12.34`. * * Negatives place the `-` before the `$`. Null/undefined/non-finite input * renders the placeholder. * * @public */ export declare function formatCompactUsd(value: FormatInput, options?: FormatOptions): string; export {}; //# sourceMappingURL=format.d.ts.map