n2words
Version:
Convert numbers to words in 70+ languages with zero dependencies. Supports BigInt, decimals, and browser/Node.js environments.
49 lines (48 loc) • 1.97 kB
TypeScript
/**
* Hungarian (Hungary) language converter
*
* CLDR: hu-HU | Hungarian as used in Hungary
*
* Key features:
* - Agglutinative structure (no spaces between compound parts)
* - Special handling for "egy" (one) omission
* - Pre-composed twenties (huszonegy through huszonkilenc)
* - "két" instead of "kettő" in compound forms
*/
export declare const cardinalMax: null;
export declare const ordinalMax: null;
export declare const currencyMax: null;
/**
* Converts a numeric value to Hungarian words.
* @param {number | string | bigint} value - The numeric value to convert
* @returns {string} The number in Hungarian words
*/
declare function toCardinal(value: number | string | bigint): string;
/**
* Converts a numeric value to Hungarian 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) // 'első'
* toOrdinal(2) // 'második'
* toOrdinal(21) // 'huszonegyedik'
*/
declare function toOrdinal(value: number | string | bigint): string;
/**
* Converts a numeric value to Hungarian currency words (Hungarian Forint).
*
* Uses forint (no plural form needed in Hungarian).
* Fillér (1/100) is rarely used but included for completeness.
* @param {number | string | bigint} value - The currency amount to convert
* @returns {string} The amount in Hungarian 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) // 'negyvenkettő forint'
* toCurrency(1.50) // 'egy forint ötven fillér'
* toCurrency(-5) // 'mínusz öt forint'
*/
declare function toCurrency(value: number | string | bigint): string;
export { toCardinal, toOrdinal, toCurrency };