Khmer Number to Words in JavaScript (km-KH) โ
Use km-KH when your application needs Khmer number words for Cambodian invoicing, checkout flows, or documents that print totals in full words.
Locale codes:
km-KHยท Numbering system: Short scale ยท Currency: แแแ (Riel) / แแแ (Sen) ยท Script: Khmer
Install โ
bash
npm install to-wordsBasic Conversion โ
js
import { ToWords } from 'to-words';
const tw = new ToWords({ localeCode: 'km-KH' });
tw.convert(100);
tw.convert(1000);
tw.convert(1000000);Currency - Riel / Sen โ
js
tw.convert(1234.56, { currency: true });
tw.convert('500.00', { currency: true, includeZeroFractional: true });Ordinal Numbers โ
js
tw.toOrdinal(1);
tw.toOrdinal(10);
tw.toOrdinal(100);Tree-shakeable (single-locale) import โ
js
import { toWords, toCurrency, toOrdinal } from 'to-words/km-KH';
toWords(1000);
toCurrency(999.99);Locale Codes โ
| Locale code | Country | Currency | Notes |
|---|---|---|---|
km-KH | Cambodia | แแแ / แแแ | Khmer script |
Related โ
FAQ โ
Q: Which locale code should I use for Khmer number-to-words output? Use km-KH.
Q: Does to-words output Khmer in the Khmer script? Yes. km-KH produces output in the Khmer script.