UNPKG

num-beauty

Version:

An ultra lightweight module for formatting numbers into human-friendly strings

17 lines (16 loc) 733 B
import { type SupportedLocale } from './locales'; import { type RoundingMode, round } from './services/rounding.service'; import { applyMask } from './services/mask.service'; import { abbreviateNumber } from './services/abbreviation.service'; import { formatNumber } from './services/formatting.service'; import { formatCurrency } from './services/currency.service'; interface NumBeautyOptions { locale?: SupportedLocale; decimals?: number; abbreviated?: boolean; stripZeros?: boolean; roundingMode?: RoundingMode; mask?: string; } export declare function beautify(number: number, options?: NumBeautyOptions): string; export { RoundingMode, round, applyMask, formatNumber, abbreviateNumber, formatCurrency };