numeric_to_words library

Legacy entrypoint for Thai number-to-words utilities.

New code can import package:thai_number_words/thai_number_words.dart. Both entrypoints export the same API: integer and decimal reading, thaiBahtText, englishCurrencyText, thaiCurrencyText, fractions, individual digits, and Thai and Roman numeral utilities.

Classes

CurrencyRegistry
Built-in English and Thai currency names for common currency codes.
CurrencyUnit
Names used by englishCurrencyText and thaiCurrencyText.
ThaiBahtTextOptions
Words and units used by the exported thaiBahtText formatter.
ThaiDecimalOptions
Words and fraction display used by thaiDecimal.
ThaiDigitsOptions
Options for reading a numeric string one digit at a time with thaiDigits.
ThaiNumberOptions
Words used when converting an integer to Thai text.

Functions

arabicDigitsToThai(String input) → String
Convert any Arabic digits in input to Thai numerals. Other chars unchanged.
englishCurrencyText(Object amount, CurrencyUnit currency) → String
Formats amount as English currency words, with a minor unit when needed.
parseRoman(String roman) → BigInt
Parse a Roman numeral string to integer (BigInt).
parseThaiInteger(String input) → BigInt
Parse an integer string consisting of Thai numerals (optional leading sign).
romanToThaiWords(String roman, {ThaiNumberOptions options = const ThaiNumberOptions()}) → String
Converts a Roman numeral string directly to Thai words. Example: 'IV' -> 'สี่', 'XV' -> 'สิบห้า'.
thaiBahtText(Object amount, {ThaiBahtTextOptions options = const ThaiBahtTextOptions()}) → String
Converts a numeric amount to Thai Baht text ("Thai Baht Text").
thaiCurrencyText(Object amount, CurrencyUnit currency) → String
Formats amount as Thai currency words, with a minor unit when needed.
thaiDecimal(num value, {ThaiDecimalOptions options = const ThaiDecimalOptions()}) → String
Reads a decimal number in Thai, pronouncing the decimal point and each digit after it. Examples:
thaiDigits(String numeric, {ThaiDigitsOptions options = const ThaiDigitsOptions()}) → String
Reads a number as individual Thai digits without composing into place-value words. Example: 12345 -> "หนึ่งสองสามสี่ห้า". Supports negative and optional decimal point word.
thaiFraction(BigInt numerator, BigInt denominator, {ThaiNumberOptions options = const ThaiNumberOptions()}) → String
Reads a fraction in Thai using the pattern "X ส่วน Y". Examples:
thaiIntToWords(int value, {ThaiNumberOptions options = const ThaiNumberOptions()}) → String
Reads an int as Thai place-value words.
thaiNumberToWords(BigInt value, {ThaiNumberOptions options = const ThaiNumberOptions()}) → String
Reads a BigInt as Thai place-value words.
thaiNumeralsToArabic(String input) → String
Convert any Thai numerals in input to Arabic digits. Other chars unchanged.