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
35 lines (34 loc) • 1.23 kB
TypeScript
import { ConverterConfig } from '../types/converterTypes';
/**
* Checks if a value is a valid non-negative number, string, or bigint.
* Handles decimals, special cases, and size validation.
*/
export declare function isValidNumber(num: number | string | bigint): boolean;
/**
* Splits a number into integer and decimal parts with proper rounding.
* Handles decimals by rounding to 2 places and managing overflow.
*/
export declare function splitNumber(num: number | string | bigint): {
integer: bigint;
decimal?: string;
};
/**
* Rounds a decimal string to 2 places.
*/
export declare function roundDecimal(decimal: string): string;
/**
* Validates that a decimal string is within expected range.
*/
export declare function validateDecimal(decimal: string | undefined): boolean;
/**
* Normalizes decimal by removing zero decimals and padding.
*/
export declare function normalizeDecimal(decimal: string | undefined): string | undefined;
/**
* Validates the entire custom mappings configuration.
*/
export declare function validateCustomMappings(config: Required<ConverterConfig>): boolean;
/**
* Converts a scale to its BigInt value.
*/
export declare function getScaleValue(scale: number | string): bigint;