Skip to content

Urdu Number to Words in JavaScript (ur-PK) โ€‹

Use ur-PK when your application needs right-to-left Urdu output for invoices, printed forms, cheque flows, or spoken-number interfaces in Pakistan.

Locale codes: ur-PK ยท Numbering system: Indian scale ยท Currency: Pakistani Rupee / Paisa ยท Script: Urdu (RTL)

Install โ€‹

bash
npm install to-words

Basic Conversion โ€‹

js
import { ToWords } from 'to-words';

const tw = new ToWords({ localeCode: 'ur-PK' });

tw.convert(137);
tw.convert(100000); // lakh-scale wording
tw.convert(10000000); // crore-scale wording

Currency - Pakistani Rupee / Paisa โ€‹

js
tw.convert(452.36, { currency: true });
tw.convert('1500.00', { currency: true, includeZeroFractional: true });

Ordinal Numbers โ€‹

js
tw.toOrdinal(1);
tw.toOrdinal(11);
tw.toOrdinal(100000);
  • Render Urdu output inside a dir="rtl" container in HTML so punctuation and UI chrome align correctly
  • ur-PK supports fraction-style decimals too, which is helpful for cheque and banking language
  • Large values follow lakh and crore conventions instead of western million-first grouping

Locale Codes โ€‹

Locale codeCountryCurrencyNotes
ur-PKPakistanRupee / PaisaRTL Urdu wording with lakh and crore groupings

FAQ โ€‹

Q: Does to-words support Urdu RTL output? Yes. ur-PK returns Urdu script, and you should render it inside an RTL container on the web.

Q: Does the Urdu locale use lakh and crore? Yes. ur-PK follows South Asian numbering with lakh and crore scale words.

Released under the MIT License.