n2words
Version:
Convert numbers to words in 70+ languages with zero dependencies. Supports BigInt, decimals, and browser/Node.js environments.
56 lines (55 loc) • 2.52 kB
TypeScript
/**
* Georgian (Georgia) language converter
*
* CLDR: ka-GE | Georgian as used in Georgia
*
* Georgian-specific rules:
* - Vigesimal (base-20) system for 20-99
* - 40 = ორმოცი (2×20), 60 = სამოცი (3×20), 80 = ოთხმოცი (4×20)
* - 30/50/70/90 use "და" + "ათი": ოცდაათი (20+10), ორმოცდაათი (40+10)
* - Compound numbers use "და" (da = "and") connector
* - Hundreds: unit prefix + ას (ორასი = 200)
* - Short scale for large numbers (მილიონი, მილიარდი, ტრილიონი)
*/
export declare const cardinalMax: bigint;
export declare const ordinalMax: bigint;
export declare const currencyMax: bigint;
/**
* Converts a numeric value to Georgian words.
*
* This is the main public API. It accepts any valid numeric input
* (number, string, or bigint) and handles parsing internally.
* @param {number | string | bigint} value - The numeric value to convert
* @returns {string} The number in Georgian 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(100) // 'ასი'
* toCardinal(1000) // 'ათასი'
*/
declare function toCardinal(value: number | string | bigint): string;
/**
* Converts a numeric value to Georgian ordinal words.
* @param {number | string | bigint} value - The numeric value to convert
* @returns {string} The ordinal in Georgian words
* @throws {TypeError} If value is not a valid numeric type
* @throws {Error} If value is not a positive integer
* @example
* toOrdinal(1) // 'პირველი'
* toOrdinal(10) // 'მეათე'
* toOrdinal(21) // 'მეოცდაერთე'
*/
declare function toOrdinal(value: number | string | bigint): string;
/**
* Converts a numeric value to Georgian Lari currency words.
* @param {number | string | bigint} value - The numeric value to convert
* @returns {string} The currency in Georgian 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 };