UNPKG

n2words

Version:

Convert numbers to words in 70+ languages with zero dependencies. Supports BigInt, decimals, and browser/Node.js environments.

19 lines (18 loc) 702 B
/** * Currency value parsing utility. * Optimized parser for currency conversion - extracts dollars and cents. * @module parse-currency */ /** * Parses a value for currency conversion. * Returns dollars and cents as separate bigints, plus negative flag. * @param {number|string|bigint} value - The value to parse * @returns {{isNegative: boolean, dollars: bigint, cents: bigint}} The parsed dollars and cents with a negative flag. * @throws {TypeError} If value is not number, string, or bigint * @throws {RangeError} If value is not finite */ export declare function parseCurrencyValue(value: number | string | bigint): { isNegative: boolean; dollars: bigint; cents: bigint; };