UNPKG

digit-to-words-nepali

Version:

A comprehensive TypeScript library for converting numbers to words in English and Nepali languages. Supports numbers up to 10^39 (Adanta Singhar), currency formatting, decimal handling with individual digit pronunciation, and BigInt. Zero dependencies, fu

26 lines (25 loc) 1.08 kB
import { BaseConverter } from './baseConverter'; import { ConverterConfig, ConversionResult } from '../types/converterTypes'; /** * EnglishConverter * Converts numbers to English words with support for currency, decimals, and custom mappings. * Optimized for readability, maintainability, and performance. */ export declare class EnglishConverter extends BaseConverter { constructor(); /** * Convert decimal digits individually to English words. * @param decimal - The decimal string (e.g., "33") * @param config - Conversion configuration * @returns Array of individual digit words */ private convertDecimalDigitsIndividually; /** * Convert a number to English words. * @param num - The number to convert * @param config - Conversion configuration (all fields required) */ convert(num: number | string | bigint, config: Required<ConverterConfig>): ConversionResult; private processNumber; } export declare const digitToEnglishWords: (num: number | string | bigint, config?: Partial<ConverterConfig>) => string;