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.94 kB
TypeScript
/**
* Bangla (Bangladesh) language converter
*
* CLDR: bn-BD | Bengali as used in Bangladesh
*
* Key features:
* - Indian numbering system (হাজার, লাখ, কোটি)
* - Bangla script (Bengali)
* - 3-2-2 grouping pattern (last 3 digits, then groups of 2)
* - Complete word forms for 0-99
*/
export declare const cardinalMax: bigint;
export declare const ordinalMax: bigint;
export declare const currencyMax: bigint;
/**
* Converts a numeric value to Bengali words.
* @param {number | string | bigint} value - The numeric value to convert
* @returns {string} The number in Bengali words
*/
declare function toCardinal(value: number | string | bigint): string;
/**
* Converts a numeric value to Bengali 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) // 'প্রথম'
* toOrdinal(2) // 'দ্বিতীয়'
* toOrdinal(3) // 'তৃতীয়'
* toOrdinal(10) // 'দশতম'
*/
declare function toOrdinal(value: number | string | bigint): string;
/**
* Converts a numeric value to Bengali currency words (Bangladeshi Taka).
* @param {number | string | bigint} value - The currency amount to convert
* @returns {string} The amount in Bengali 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) // 'বেয়াল্লিশ টাকা পঞ্চাশ পয়সা'
* toCurrency(1) // 'এক টাকা'
* toCurrency(0.01) // 'এক পয়সা'
*/
declare function toCurrency(value: number | string | bigint): string;
export { toCardinal, toOrdinal, toCurrency };