import { Maybe } from 'yummies/types'; import { parser } from 'yummies/parser'; declare const NO_VALUE = "\u2013"; declare const HYPHEN = "-"; declare const INFINITY = "\u221E"; interface NumberFormatSettings { delimiter?: string; /** * digitsOnlyForFloat - Show digits after decimal point only if they are not zeros after converting to number. * Example: "0.00" -> "0", "0.10" -> "0.1", but "0.003" -> "0.003" * * @default true */ digitsOnlyForFloat?: boolean; /** * Text which will be returned if the value is undefined, null, NaN, Infinity or empty string. * Example: "–" will be returned if the value is undefined and emptyText is "–". */ emptyText?: string; /** * Text to append to the end of the formatted number. * Example: if value is 1000 and postfix is "₽", result will be "1 000₽". */ postfix?: string; /** * Fixed number of digits after the decimal point (number.toFixed() method) * If set to false, the truncation is ignored! */ digits?: number | false; /** * Remove trailing zeros from the end of the number * Example: 0.010000000000000000000000000000000000000000000 -> 0.01 */ cutZeros?: boolean; cropDigitsOnly?: boolean; } declare const number: { (rawValue: Maybe, userSettings?: Maybe): string; defaultSettings: NumberFormatSettings; }; interface PercentFormatSettings extends Omit { divider?: string; delimiter?: string; symbol?: string; emptyText?: string; } /** * 100 -> 100% * 99.123214412 -> 99.12% * 99.123214412 -> 99,12% */ declare const percent: (value: Maybe, settings?: PercentFormatSettings) => string; /** * Removes all spaces in string */ declare const skipSpaces: (value: string) => string; declare const _exports_HYPHEN: typeof HYPHEN; declare const _exports_INFINITY: typeof INFINITY; declare const _exports_NO_VALUE: typeof NO_VALUE; type _exports_NumberFormatSettings = NumberFormatSettings; type _exports_PercentFormatSettings = PercentFormatSettings; declare const _exports_number: typeof number; declare const _exports_percent: typeof percent; declare const _exports_skipSpaces: typeof skipSpaces; declare namespace _exports { export { _exports_HYPHEN as HYPHEN, _exports_INFINITY as INFINITY, _exports_NO_VALUE as NO_VALUE, _exports_number as number, _exports_percent as percent, _exports_skipSpaces as skipSpaces }; export type { _exports_NumberFormatSettings as NumberFormatSettings, _exports_PercentFormatSettings as PercentFormatSettings }; } export { _exports as format };