n2words
Version:
Convert numbers to words in 70+ languages with zero dependencies. Supports BigInt, decimals, and browser/Node.js environments.
20 lines (19 loc) • 768 B
TypeScript
/**
* Cardinal value parsing utility.
* Transforms user input (number, string, or bigint) into normalized components.
* Handles negatives, decimals, and scientific notation.
* @module parse-cardinal
*/
/**
* Parses a value for cardinal conversion.
* Cardinals accept any numeric value: integers, decimals, negatives.
* @param {number|string|bigint} value - The value to parse
* @returns {{isNegative: boolean, integerPart: bigint, decimalPart?: string}} The parsed cardinal components
* @throws {TypeError} If value is not number, string, or bigint
* @throws {RangeError} If value is not finite
*/
export declare function parseCardinalValue(value: number | string | bigint): {
isNegative: boolean;
integerPart: bigint;
decimalPart?: string;
};