thb-text
Version:
Thai Baht Text converter - converts numbers to Thai text representation for currency amounts
42 lines (41 loc) • 1.69 kB
TypeScript
export declare enum Unit {
Baht = 0,
Million = 1,
Billion = 2,
Trillion = 3
}
export interface ThaiBahtTextOptions {
unit: Unit;
appendBahtOnly: boolean;
decimalPlaces: number;
}
export declare class ThaiBahtTextUtil {
static readonly MAX_VALUE = 999999999999.99;
static readonly MIN_VALUE = -999999999999.99;
private static readonly THAI_MILLION;
private static readonly THAI_BAHT;
private static readonly THAI_SATANG;
private static readonly THAI_ONE;
private static readonly THAI_ET;
private static readonly THAI_NEGATION;
private static readonly THAI_TEN;
private static readonly THAI_TWENTY;
private static readonly THAI_PERIOD;
private static readonly THAI_ONLY;
private static readonly thaiPlaces;
private static readonly thaiNumbers;
static thaiBahtText(amount: number | null | undefined, options?: Partial<ThaiBahtTextOptions>): string;
static thaiBahtText(amount: number | null | undefined, unit?: Unit, decimalPlaces?: number, appendBahtOnly?: boolean): string;
private static decompose;
private static speakDotTo;
private static speakTo;
}
export declare function thaiBahtText(amount: number | null | undefined, options?: Partial<ThaiBahtTextOptions>): string;
export declare function thaiBahtText(amount: number | null | undefined, unit?: Unit, decimalPlaces?: number, appendBahtOnly?: boolean): string;
declare global {
interface Number {
thaiBahtText(options?: Partial<ThaiBahtTextOptions>): string;
thaiBahtText(unit?: Unit, decimalPlaces?: number, appendBahtOnly?: boolean): string;
}
}
export declare function registerNumberPrototype(): void;