to-words
Version:
Convert numbers to words in 132 locales with currency, ordinal, and BigInt support (TypeScript, ESM/CJS/UMD).
31 lines (30 loc) • 1.2 kB
TypeScript
import { type ConverterOptions, type LocaleConfig, type LocaleInterface, type NumberInput, type OrdinalOptions, type ToWordsOptions } from '../types.js';
import { ToWordsCore } from '../ToWordsCore.js';
export default class Locale implements LocaleInterface {
config: LocaleConfig;
}
/**
* ToWords class pre-configured for this locale.
* This is a lightweight version that only bundles this specific locale.
*
* @example
* import { ToWords } from 'to-words/ru-RU';
* const tw = new ToWords();
* tw.convert(1234);
*/
export declare class ToWords extends ToWordsCore {
constructor(options?: ToWordsOptions);
}
/**
* Convert a number to words for this locale (functional style).
*/
export declare function toWords(number: NumberInput, options?: ConverterOptions): string;
/**
* Convert a number to ordinal words for this locale (functional style).
*/
export declare function toOrdinal(number: NumberInput, options?: OrdinalOptions): string;
/**
* Convert a number to currency words for this locale (functional style).
* Shorthand for toWords(number, { currency: true, ...options }).
*/
export declare function toCurrency(number: NumberInput, options?: ConverterOptions): string;