n2words
Version:
Convert numbers to words in 70+ languages with zero dependencies. Supports BigInt, decimals, and browser/Node.js environments.
48 lines (47 loc) • 1.88 kB
TypeScript
/**
* Filipino (Philippines) language converter
*
* CLDR: fil-PH | Filipino as used in the Philippines
*
* Key features:
* - Linker "ng" after vowels: "isang daang" (100)
* - Linker " na " after consonants: "siyam na daang" (900)
* - Special tens with linker: "limampung anim" (56)
* - Per-digit decimal reading
*/
export declare const cardinalMax: bigint;
export declare const ordinalMax: bigint;
export declare const currencyMax: bigint;
/**
* Converts a numeric value to Filipino words.
* @param {number | string | bigint} value - The numeric value to convert
* @returns {string} The number in Filipino words
*/
declare function toCardinal(value: number | string | bigint): string;
/**
* Converts a numeric value to Filipino ordinal words.
* @param {number | string | bigint} value - The numeric value to convert (positive integer)
* @returns {string} The number as ordinal words
* @throws {TypeError} If value is not a valid numeric type
* @throws {RangeError} If value is negative, zero, or has a decimal part
* @example
* toOrdinal(1) // 'una'
* toOrdinal(2) // 'ikalawa'
* toOrdinal(3) // 'ika-tatlo'
*/
declare function toOrdinal(value: number | string | bigint): string;
/**
* Converts a numeric value to Filipino currency words (Philippine Peso).
*
* Uses piso (peso) and sentimo (centavo).
* @param {number | string | bigint} value - The currency amount to convert
* @returns {string} The amount in Filipino currency words
* @throws {TypeError} If value is not a valid numeric type
* @throws {Error} If value is not a valid number format
* @example
* toCurrency(42) // 'apatnapu dalawang piso'
* toCurrency(1.50) // 'isang piso at limampung sentimo'
* toCurrency(-5) // 'negatibo limang piso'
*/
declare function toCurrency(value: number | string | bigint): string;
export { toCardinal, toOrdinal, toCurrency };