n2words
Version:
Convert numbers to words in 70+ languages with zero dependencies. Supports BigInt, decimals, and browser/Node.js environments.
50 lines (49 loc) • 1.97 kB
TypeScript
/**
* Greek (Greece) language converter
*
* CLDR: el-GR | Greek as used in Greece
*
* Key features:
* - Space-separated number composition
* - Implicit "one" (ένα) omission before scale words
* - Irregular hundreds (διακόσια, τριακόσια, etc.)
* - Per-digit decimal reading
*/
export declare const cardinalMax: bigint;
export declare const ordinalMax: bigint;
export declare const currencyMax: bigint;
/**
* Converts a numeric value to Greek words.
* @param {number | string | bigint} value - The numeric value to convert
* @returns {string} The number in Greek words
* @throws {TypeError} If value is not a valid numeric type
* @throws {Error} If value is not a valid number format
* @example
* toCardinal(21) // 'είκοσι ένα'
* toCardinal(1000) // 'χίλια'
* toCardinal('3.14') // 'τρία κόμμα ένα τέσσερα'
*/
declare function toCardinal(value: number | string | bigint): string;
/**
* Converts a numeric value to Greek ordinal words.
* @param {number | string | bigint} value - The numeric value to convert
* @returns {string} The ordinal in Greek words
* @throws {TypeError} If value is not a valid numeric type
* @throws {Error} If value is not a positive integer
* @example
* toOrdinal(1) // 'πρώτος'
* toOrdinal(21) // 'εικοστός πρώτος'
*/
declare function toOrdinal(value: number | string | bigint): string;
/**
* Converts a numeric value to Greek Euro currency words.
* @param {number | string | bigint} value - The numeric value to convert
* @returns {string} The currency in Greek words
* @throws {TypeError} If value is not a valid numeric type
* @throws {Error} If value is not a valid number format
* @example
* toCurrency(1) // 'ένα ευρώ'
* toCurrency(2.50) // 'δύο ευρώ πενήντα λεπτά'
*/
declare function toCurrency(value: number | string | bigint): string;
export { toCardinal, toOrdinal, toCurrency };