Skip to content

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-words

Basic 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 codeCountryCurrencyNotes
km-KHCambodiaแžšแŸ€แž› / แžŸแŸแž“Khmer script

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.

Released under the MIT License.