n2words
Version:
Convert numbers to words in 70+ languages with zero dependencies. Supports BigInt, decimals, and browser/Node.js environments.
47 lines (46 loc) • 1.89 kB
TypeScript
/**
* Amharic (Ethiopia, Latin script) language converter
*
* CLDR: am-Latn-ET | Amharic as used in Ethiopia (Latin script romanization)
*
* Key features:
* - Romanized numerals (and, hulet, sost)
* - Teens formed with "asra" prefix
* - Keeps "one" before hundred: "and meto" (100)
* - Short scale naming
* - Per-digit decimal reading
*/
export declare const cardinalMax: bigint;
export declare const ordinalMax: bigint;
export declare const currencyMax: bigint;
/**
* Converts a numeric value to Amharic (Latin script) words.
* @param {number | string | bigint} value - The numeric value to convert
* @returns {string} The number in Amharic Latin words
*/
declare function toCardinal(value: number | string | bigint): string;
/**
* Converts a numeric value to Amharic (Latin script) 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) // 'andenya'
* toOrdinal(2) // 'huletnya'
* toOrdinal(10) // 'asirnya'
*/
declare function toOrdinal(value: number | string | bigint): string;
/**
* Converts a numeric value to Amharic (Latin script) currency words (Ethiopian Birr).
* @param {number | string | bigint} value - The currency amount to convert
* @returns {string} The amount in Amharic (Latin) 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.50) // 'arba hulet birr hamsa santim'
* toCurrency(1) // 'and birr'
* toCurrency(0.01) // 'and santim'
*/
declare function toCurrency(value: number | string | bigint): string;
export { toCardinal, toOrdinal, toCurrency };