↑ Top
GitHubArqam

Arqam manual

Welcome

Turn numbers into correct Arabic words

Amounts, dates, ordinals and units, with the right grammar and, if you want it, full vowel marks. This manual starts with the basics and goes as deep as you need.

Start: Getting started → Use it in my code

1,250.75 SAR · Saudi riyal

ألف ومائتان وخمسون ريالًا سعوديًا، وخمس وسبعون هللةً

188currencies
252units of measure
6tashkeel modes
3grammatical cases
∞digits and fractions: no size limit
579questions answered

Arabic number-to-words (tafqeet) for amounts, numbers, units, ordinals and dates — Arqam 2.0.0 — Mohsen Alyafei

Popular tasks

1. Getting started

Arqam is a single page that works without the internet: open index.html in any modern browser (Chrome, Edge, Firefox, Safari) on a computer or phone.
Nothing leaves your device; your settings are stored in the browser itself.

The top bar has the display-mode switch سريع · احترافي · مستندات (section 2), عن الصفحة (Info: how the types and options work), حول أرقام (About), داكن (dark mode) and an English button (not active yet).
Below it is the work row: تحويل رقم (Single) or تحويل دفعة (Batch), then the conversion type: عملات Currencies · أعداد فقط Numbers only · وحدات قياس Other units · أعداد ترتيبية Ordinals · التاريخ Date, with a ? that explains them.

Every control carries a small English label under its Arabic one.

In «احترافي», on a desktop the Options panel sits beside the result; on a phone the "الخيارات" button at the bottom opens it.

2. The three display modes

The same page can be shown in three ways.
The switch سريع · احترافي · مستندات sits in the top bar (on a phone and tablet also in the ☰ menu under «طريقة العرض», with a picture of each).

The page remembers your choice in this browser, as it remembers dark mode.
Switching never loses anything: the number, the currency, the type and every option stay as they were.

A link can open a mode: index.html?view=quick, ?view=studio or ?view=docs.

2.1 «سريع» (Quick): one box for everything

The page opens in this mode on a first visit, with a short welcome note shown once.
Type anything in the one box and the page works out what it is:

1234.56 QAR, QAR 50, $100→an amount in that currency (codes and the signs $ € £ ¥ ₹)
20/11/2026, 2026-11-20→a date
15:45, 3:15 م, 3:15 pm→a time (الساعة الرابعة إلا الربع عصرًا)
3/4, 3 ½, ¾→a fraction (ثلاثة أرباع، ثلاثة ونصف); with a unit or a currency it stays a unit or an amount: 3 ½ كم → ثلاثة كيلومترات ونصف
12.5%→a percentage
21 مؤنث, 21st→an ordinal (مؤنث or ترتيبية: feminine; مذكر or ترتيبي: masculine; 21st: as the ordinal picker is set)
3 كم, 12.5 متر→a unit of measure
ألفان وخمسمائة→Arabic words back to numbers
1234→a plain number keeps the current type (an amount on a first visit)

Above the examples, the row النوع: shows the eight types (مبلغ، عدد، وحدة قياس، ترتيبي، تاريخ، وقت، كسر، كلمات ← أرقام), the one in use highlighted; tap one to choose it, before or after typing (for example «ترتيبي», then 21).
The choice stays for plain numbers until ✕ or an example is used, while text of another clear type (an amount with its code, a date, a time, a fraction, Arabic words) switches to that type at once.

Below the examples, a line of text says what was understood («فُهم على أنه»), with the currency, the unit or the ordinal's gender: «مبلغ · ريال قطري», «ترتيبي · مؤنث», «كلمات ← أرقام»; after a choice it says «اخترت:».
It is hidden while the box is empty and nothing was chosen.

A currency, unit or ordinal gender chosen in the lists wins over the one written in the box: the box then keeps only the number, so editing it does not bring the old choice back.
The welcome note of a first visit closes at the first tap or key anywhere else.

Example chips («جرّب») fill the box for you.
«خيارات» opens the main settings (tashkeel, case, legal form, numerals) and a link to every option in «احترافي».

Under the words three tabs appear when they have something to show: صيغ أخرى (other forms, below), الإعراب (the «اشرح» panel: the case of every word) and للمطورين (the exact library call that gives these words, with a copy button).

2.2 «احترافي» (Studio): every option

The full page described in sections 3 to 8: single and batch conversion, the conversion types, and the options panel.
At the top of the panel, quick settings give one-tap access to tashkeel, case (الإعراب), the legal form and the numerals; they change the same options as the panel below.

Under the words:

2.3 «مستندات» (Documents): the amount in a document

Type the amount and choose the currency, then a template:

Five switches: «فقط … لا غير» (on), the figure in brackets after the words (off; the cheque and receipt already have the figure box), full tashkeel (off: the words then carry the tanween alif only, ألفًا, as on cheques) the Hijri date as well (on), and the time on the date line (off; the time is typed beside the date, e.g. «الساعة العاشرة والنصف صباحًا»).
نسخ المبلغ بالحروف copies the words, نسخ المستند the whole document as text, and طباعة prints the document alone.

The names and numbers you type for a document are for the preview and printing only; they are never saved.
On entering this mode the type becomes «عملات»; leaving it puts the previous type back.

Why Arqam?

Many websites and libraries turn numbers into Arabic words, and many get the grammar wrong: the gender of the number against the counted noun for three to ten, the dual, the case endings, the scale words, large numbers, fractions.

Arqam was written so that a number or an amount — on a cheque, an invoice, a contract — comes out in correct Arabic every time, with the options a real document needs, and free for everyone.

Arqam (أرقام) means "numbers"; the Arabic engine is arqamAR, the English one arqamEN.

What you needArqamExample
Numbers and amounts in words (تفقيط)188 currencies, 252 units of measure, ordinals, percentages, Gregorian and Hijri dates, times and fractions
1,250.75 QAR
No limit on the size of the numberany number of whole and decimal digits: only the computer's memory sets the limit. Words back to numbers reads whole numbers of up to thirty-six (36) digits
10303
إعراب: الرفع والنصب والجرoption ierab
3 QAR, ierab: "nasb"
3 QAR, ierab: "jarr"
Tashkeel (التشكيل)six (6) modes, from none to full: option tashkeel
1,250.75 QAR, tashkeel: "full"
«اشرح»: the grammar of every wordevery word with its إعراب, the reason and the rule: arqam/explain1,250.75 QAR:
Words back to numbersarqam/words: dialect words too, and verify() checks words against their figure
→ 1250.75
dialect → 3500
Legal form for cheques and contractsoption legal
302,000 (the default, auto)
302,000, legal: "none"
The words in parts, for separate fieldsformatToParts(): the number, the decimals, the currency and the sub-unit, each labelled1,250.50 QAR:
integer ألف
integer مائتان وخمسون
currency ريالًا قطريًا
fraction خمسون
minorCurrency درهمًا
Ranges in words («من … إلى …»)formatRange() for numbers, currencies, counted nouns, units, percentages, ordinals, fractions, times, Gregorian and Hijri dates
1,000–2,000 QAR
09:00–17:30
1–15 Nov 2026, Hijri
Testsseventy-six (76) engine Test Cases
seven hundred and sixty-six (766) words-to-numbers cases
50,709 «اشرح» calls (238,702 words) checked word by word, with no mismatch
more than 160,000 random checks in eleven (11) parts
thirty-three (33) page-test files in a real browser

Features at a glance

What Arqam does, in one view.
Each item links to the chapter that explains it.

188currencies
252units of measure
6tashkeel modes
10decimal formats
3grammatical cases
8NumberFormat styles
579FAQ answers

Arabic grammar

  • Correct Arabic in every case: the gender of 3–10 against the counted noun, the dual, and the counted noun after the number (التمييز).
  • Full iʿrāb: الرفع والنصب والجر — the amount in a sentence.
  • 6 tashkeel modes, from none to full (تشكيل الحروف كاملًا أو جزئيًّا), and the tanween alone.
  • The legal (accountant) form for cheques and contracts (الكتابة المحاسبية القانونية), in two levels.
  • The compact form preferred by the press (الكتابة المختصرة).
  • The classical reading order, the smallest part first (خمسون ومائتان وألف).
  • Approximate quantities: قرابة ألف ريال، ما يزيد على مليون، بضعة آلاف، نيّف وعشرون — approximate quantities.

Numbers and decimals

  • The Arabic, short and long scales — numbering system.
  • No limit on the size of a number or on the number of its decimals, with no option needed — the number you pass.
  • 10 decimal formats — fractions.
  • Rounding or cutting of extra digits.
  • Negative numbers (سالب), percentages (بالمائة) and ordinals, masculine or feminine, with or without ال.
  • Arabic-Eastern numbers (٠١٢٣) with the Arabic decimal separator ٫ (U+066B) and thousands separator ٬ (U+066C), e.g. ١٬٠٠٠٬٠٠٠٫٥; or Arabic-Western numbers (0123).

Currencies and units

  • 188 currencies: 173 ISO 4217 codes (every current one, and withdrawn ones for old documents), 2 regional currencies and 13 cryptocurrencies, each with its sub-unit.
  • Add a new currency or change an existing one in one call — registerCurrency().
  • 252 units of measure in 18 groups (distance, area, volume, mass, speed, time …), with their Intl names (140).
  • فقط … لا غير and any prefix or suffix.
  • The amount in figures in brackets, with the code, the symbol or the name — number in brackets.

Dates, times and fractions

  • Dates in words, Gregorian, Hijri (Umm al-Qura) or both — toDate().
  • Month names of the Gulf, the Levant and the Maghreb, غرة, سنة / عام and the era.
  • The time of day in four styles, and durations — time.
  • Regions and time zones: one option gives the 22 Arab locales their currency, month names, digits and time zone; an exact moment is written in its zone, بتوقيت الدوحة — regions and time zones.
  • Typed fractions (3/4, 3 ½) in three forms, with a currency or a unit — fractions.

The page

  • Three display modes: سريع for everyone, احترافي with every option, مستندات for cheques, invoices, contracts and receipts — display modes.
  • Batch conversion of many numbers at once — batch.
  • Other forms of the same words, and the grammar of each word (الإعراب).
  • Colours for the number groups and the vowel marks; copy as text or as an image — copy and export.
  • Works offline; nothing leaves your device; dark mode.

For developers

  • toWords(), toParts(), toDate(), toTime(), toFraction() and instances with their own options.
  • arqam.NumberFormat: the Intl.NumberFormat way of working, in Arabic words, with eight styles.
  • formatToParts(): the words cut into labelled parts (number, currency, fraction …) for colours, cheques and screen readers.
  • formatRange(): ranges in words, «من ألف ريال قطري إلى ألفي ريال قطري», with both values in the correct case.
  • Words back to numbers, dialects included — arqamWordsToNumbers.
  • The grammar of every word — arqamExplain.
  • Options checked with clear errors; TypeScript declarations.
  • Readable ES modules; no dependencies, no network; npm package arqam.

Everyday tasks

The common jobs, one at a time: what to do on the page, and the same in code. The steps use the «احترافي» (Studio) display mode, which shows every control; «سريع» (Quick) does the same from one box (section 1a).

Write an amount for a cheque

A cheque needs the amount in words, usually between فقط and لا غير so nothing can be added later.
Arqam gives the currency's own names in the right number and case.

On the page

  1. Choose تحويل رقم (Single) and عملات (Currencies) in the work row.
  2. Type the amount, for example 1250.75. Thousands separators are not needed.
  3. Pick the currency in the menu: type its name or code (QAR) in the menu's search box.
  4. Tick قبل (before) and بعد (after) to add فقط and لا غير.
  5. Press نسخ (Copy). To print the whole cheque or a receipt, use the «مستندات» (Documents) mode.

In code

arqam("1250.75", {currency: "SAR", prefix: "فقط", suffix: "لا غير"})
→فقط ألف ومائتان وخمسون ريالًا سعوديًا، وخمس وسبعون هللةً لا غير
arqam("1250.75", {currency: "SAR", prefix: "فقط", suffix: "لا غير", brackets: "end"})
→فقط ألف ومائتان وخمسون ريالًا سعوديًا، وخمس وسبعون هللةً لا غير (1,250.75 SAR)
with the amount in figures for the bank

More: The currency menu, before and after · Legal mode · The Documents mode · Questions on cheques and invoices

Write a date, Gregorian or Hijri

Dates are written as ordinal day, month and year, with للميلاد or للهجرة; both calendars can be given together.

On the page

  1. Choose التاريخ (Date) in the work row.
  2. Type the date as day/month/year, for example 25/11/2026, or pick it in the calendar.
  3. Open the date settings to choose the calendar (Gregorian, Hijri or both), the style and the month names (Gulf, Levant, Maghreb).

In code

arqam.toDate("2026-11-25")
→الخامس والعشرون من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد
arqam.toDate("2026-11-25", {calendar: "both"})
→الخامس والعشرون من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد، الموافق الخامس عشر من شهر جمادى الآخرة لعام ألف وأربعمائة وثمانية وأربعين للهجرة

More: Dates on the page · toDate() in depth · Questions on dates

Write a time or a fraction

A time is written as the hour, the minutes and the part of the day; a fraction such as ½ or ¾ by its own name.

On the page

  1. For a time, choose الوقت (Time) and type it as 15:45 or 3:45 م.
  2. For a fraction, type it in the number box: 3 1/2, 3½ or 3/4.

In code

arqam.toTime("15:45")
→الساعة الثالثة وخمس وأربعون دقيقةً عصرًا
arqam.toTime("1:30", {timeStyle: "duration"})
→ساعة ونصف
arqam.toFraction("3 1/2")
→ثلاثة ونصف

More: Times on the page · Fractions on the page · toTime() and toFraction() in depth

Write an ordinal: the first, the 21st

Ordinals go up to 999,999, masculine (البند، الملحق) or feminine (المادة، الفقرة), with or without ال.

On the page

  1. Choose أعداد ترتيبية (Ordinals) in the work row.
  2. Choose masculine or feminine, and with or without ال in the list next to it.
  3. Type the number, for example 21.

In code

arqam("21", {ordinal: "feminine"})
→الحادية والعشرون
arqam("21", {ordinal: "masculine", ordinalDefinite: "off"})
→حاد وعشرون

More: Ordinals on the page · Ordinals in code

Write a unit of measure

252 units of length, weight, volume, speed, time, data and more, each with its sub-unit: metres and centimetres, kilometres per hour.

On the page

  1. Choose وحدات قياس (Other units) in the work row.
  2. Pick the unit in its menu (type part of its name to find it).
  3. Type the number, for example 12.5.

In code

new arqam.NumberFormat("ar", {style: "unit", unit: "kilometer-per-hour"}).format(120)
→مائة وعشرون كيلومترًا في الساعة
new arqam.NumberFormat("ar", {style: "unit", unit: "meter"}).format(12.5)
→اثنا عشر مترًا، وخمسون سنتيمترًا

More: Units on the page · Questions on units

Write many numbers at once

A column of amounts, or a table pasted from Excel, comes back as words line by line, ready to paste back or download.

On the page

  1. Choose تحويل دفعة (Batch).
  2. Paste one number per line, or the cells of an Excel table; a currency code on a line (1250.5 KWD) applies to that line.
  3. Open the output tab, choose the columns (text only, invoice, accounting…), then copy or download Excel or CSV.

In code

arqam(["1250.5", "99", "-45"], {currency: "EGP"})
→ألف ومائتان وخمسون جنيهًا مصريًا، وخمسون قرشًاتسعة وتسعون جنيهًا مصريًاسالب خمسة وأربعين جنيهًا مصريًا

More: Batch conversion in detail · Copy and export

Add vowel marks or change the case

Arabic can be written without marks, with the case endings only, or fully vowelled; and the number takes the case of its place in your sentence: رفع، نصب، جر.

On the page

  1. In the options, choose Tashkeel: none, the endings only, or full.
  2. In the options, choose Ierab: nominative, accusative or genitive, as your sentence needs.

In code

arqam("1250.75", {currency: "MAD", tashkeel: "endings"})
→ألفٌ ومائتانِ وَخمسونَ درهمًا مغربيًّا، وَخمسةٌ وَسبعونَ سنتيمًا
arqam("3", {currency: "KWD", tashkeel: "full", ierab: "nasb"})
→ثَلَاثَةَ دَنَانِيرَ كُوَيْتِيَّةٍ

More: Tashkeel · Ierab · The case of the amount in a sentence · Explain the grammar of each word

Read words back as a number

Arqam also reads Arabic number words, dialects included, and gives the figure back: useful to check what someone typed.

On the page

  1. In «سريع» (Quick), type or paste the words: the line below the examples says كلمات ← أرقام.

In code

arqam.fromWords("ألف ومائتان وخمسون ريالا قطريا")
→"1250"
arqam.findNumbers("دفع خمسة وعشرين دينارا كويتيا وثلاثمائة فلس")
→
start4
end43
textخمسة وعشرين دينارا كويتيا وثلاثمائة فلس
value"25.3"
currency"KWD"
nounدينارا كويتيا
places3

More: Words back to numbers in depth · Questions on reading words

3. Single conversion

3.1 The number field

Type the number, then press space or wait a moment; the words appear at once.
Accepted:

-250→سالب مائتين وخمسين
-1250.5 AED, «before» on, brackets→فقط سالب ألف ومائتين وخمسين درهمًا إماراتيًا، وخمسين فلسًا (-1,250.50 AED)
-0.001 QAR→صفر ريال قطريwritten as 0: no «سالب»
12.05%→اثنا عشر فاصلة صفر خمسة بالمائة
25%, brackets→خمسة وعشرون بالمائة (25%)

Not accepted: scientific notation (1e6), more than one decimal point, letters.
The whole part may have up to 3002 digits (6000 on the long scale).

3.2 The currency menu, "before" and "after"

In currency mode a menu lists 186 currencies with flags, including cryptocurrencies.
Type a name or a code (KWD) in its search box.

Withdrawn currencies stay for reading old documents and are marked «ملغاة» with the year.

The قبل box adds «فقط» (only) before the words and بعد adds «لا غير» (and nothing else) after them; both words can be changed in the options:

1234.56→فقط ألف، ومائتان وأربعة وثلاثون ريالا قطريا، وستة وخمسون درهما لا غير

3.3 The words panel

Text direction: when you paste the words into a field or cell that also holds figures or Latin letters, set the field to right-to-left; in Excel: Format Cells → Alignment → Text direction: Right-to-Left.

تلوين الكلمات colours each scale group (thousands, hundreds…) differently, the currency red and punctuation black.
تلوين التشكيل colours the vowel marks (several colours, red or blue); the marks stay exactly where they are without colour, and words are never split across lines.

نسخ copies the words with their colours, the mark colours included (coloured in Word, plain text elsewhere); the ▾ beside it gives an image (section 7).

4. Conversion types

4.1 Currencies

1234.56→ألف، ومائتان وأربعة وثلاثون ريالا قطريا، وستة وخمسون درهماQatari riyal
1250.5→ألف، ومائتان وخمسون دينارا كويتيا، وخمسمائة فلسKuwaiti dinar: three places
2→ينّان يابانيان اثنانyen: no fraction
1→دولار أمريكي واحد
2→دولاران أمريكيان اثنانthe dual
11→أحد عشر دولارا أمريكيا
0.00512→خمسمائة واثنا عشر جزءا من المائة ألف من البتكوينcryptocurrencies: the fraction as given

4.2 Numbers only

1234.56→ألف، ومائتان وأربعة وثلاثون، وستة وخمسون جزءا من المائة
0.5→خمسة أجزاء من العشرة

4.3 Other units

Choose a unit from the list (length, weight, volume, time…); the number is written with the unit and its sub-unit:

12.5→اثنا عشر مترا، وخمسون سنتيمتراmetres and centimetres
2.5→كيلومتران في الساعة، وخمسمائة متر في الساعةkilometres per hour: «في الساعة» follows the number and the minor unit
2→ملعقتا شايteaspoon (feminine)
1.25→ملعقة شاي، وخمسة وعشرون جزءًا من المائة من ملعقة الشايno minor unit: the decimals as typed
0.5→خمسة أجزاء من العشرة من السنة الهجريةHijri year: the adjective below one
12.5→اثنا عشر مترًا في الثانية، وخمسون سنتيمترًا في الثانية (12.50 م/ث)brackets with the unit's symbol

4.4 Ordinals

First, second… up to 999,999, with masculine (البند، الملحق) or feminine (المادة، الفقرة).
From 101 upwards: «الخامس والعشرون بعد المائة».

1 · masculine→الأول
1 · feminine→الأولى
2 · feminine→الثانية
11 · masculine→الحادي عشر
12 · feminine→الثانية عشرة
21 · masculine→الحادي والعشرون
100 · feminine→المائة
101 · masculine→الحادي بعد المائة
125 · feminine→الخامسة والعشرون بعد المائة
1000 · masculine→الألف
125 · masculine→الْخَامِسُ وَالْعِشْرُونَ بَعْدَ الْمِائَةِ

4.5 Date

Type 16/11/2026, 2026-11-16 or 16 نوفمبر 2026 and choose the calendar: Gregorian, Hijri (Umm al-Qura) or both.
A Hijri date can be typed too: 16/11/1447هـ, 16/11/1447 هجري or 16 ذو القعدة 1447 are read as Hijri, and 16/11/2026م as Gregorian; Both pickers start at تلقائي: the words follow the calendar the date was read in, and a date with no mark and no Hijri month name is Gregorian.

Choose ميلادي, هجري or both in التقويم to convert, and التاريخ المدخل: هجري to read figures without a mark as Hijri.

In سريع a Hijri date is written in Hijri.
See A Hijri date as input.

الصيغة (style): كلمات writes the day and the year in words, اليوم كلمات the day in words and the year in figures, مختصر both in figures.

خيارات التاريخ (collapsed) holds the rest: a Hijri date as input (8/6/1448, 8 جمادى الآخرة 1448), the month names (يناير for the Gulf and Egypt, كانون الثاني for the Levant and Iraq, both together as in the Levant, جانفي for Algeria and Tunisia, or the Moroccan names), the word before the year (لعام، سنة، عام), what follows it (للميلاد / ميلادية, or م / هـ) and «غرة» for the first day.
The order is always day/month/year and the year has four digits.

اليوم (Today) puts in today's date, in Hijri when the input is Hijri.

16/11/2026→السادس عشر من شهر نوفمبر لعام ألفين وستة وعشرين للميلادكلمات, Gregorian
16/11/2026→السادس عشر من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد، الموافق السادس من شهر جمادى الآخرة لعام ألف وأربعمائة وثمانية وأربعين للهجرةGregorian and Hijri
16/11/2026→السادس عشر من شهر نوفمبر سنة 2026 ميلاديةاليوم كلمات
16/11/2026→16 نوفمبر 2026م، الموافق 6 جمادى الآخرة 1448هـمختصر, both calendars
1/3/1945→غرة مارس/آذار 1945مmonths together, غرة
5/7/2026→5 جويلية 2026مAlgeria and Tunisia
1 رمضان 1447→1 رمضان 1447هـ، الموافق 18 فبراير 2026مHijri input

4.6 The Levant date

In Iraq, Syria, Jordan, Lebanon and Palestine a date often gives the Gregorian month and the Assyrian (Syriac) month together, separated by a slash: «٣١ يناير/كانون الثاني ٢٠٢٢».
Choose أسماء الشهور: يناير/كانون الثاني on the page, or months: "both" in the library.

JavaScript's own locales give only one of the two names.

The Arabic Levant date ٣١ يناير/كانون الثاني ٢٠٢٢: the day in Arabic-Eastern numbers, the Gregorian month, a slash, the Assyrian month, and the Gregorian year in Arabic-Eastern numbers
The Arabic Levant date format (Mohsen Alyafei, 2022).

4.7 Month names in the Arabic locales of JavaScript

ISO 639 Arabic language list and the default displays in JavaScript (toLocaleDateString(locale, {dateStyle: "long"}) for 27 January 2022).
Arqam writes its month names from its own tables, so the words are the same in every browser; the last column shows which choice gives each family of names.

ISO 639 Arabic Language List and Default Displays in Javascript
Language codeLocaleMonth namesDefault long dateMonth typeDefault numbersIn Arqam
arArabic (ar)يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر٢٧ يناير ٢٠٢٢Gregorian months EnglishArabic-Easternmonths: "gulf"
ar-001Arabic (World)يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر٢٧ يناير ٢٠٢٢Gregorian months EnglishArabic-Easternmonths: "gulf"
ar-AEArabic (UAE)يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر٢٧ يناير ٢٠٢٢Gregorian months EnglishArabic-Easternmonths: "gulf"
ar-BHArabic (Bahrain)يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر٢٧ يناير ٢٠٢٢Gregorian months EnglishArabic-Easternmonths: "gulf"
ar-DJArabic (Djibouti)يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر٢٧ يناير ٢٠٢٢Gregorian months EnglishArabic-Easternmonths: "gulf"
ar-DZArabic (Algeria)جانفي، فيفري، مارس، أفريل، ماي، جوان، جويلية، أوت، سبتمبر، أكتوبر، نوفمبر، ديسمبر27 جانفي 2022Gregorian months FrenchArabic-Westernmonths: "maghreb"
ar-EGArabic (Egypt)يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر٢٧ يناير ٢٠٢٢Gregorian months EnglishArabic-Easternmonths: "gulf"
ar-EHArabic (Western Sahara)يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر27 يناير 2022Gregorian months EnglishArabic-Westernmonths: "gulf"
ar-ERArabic (Eritrea)يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر٢٧ يناير ٢٠٢٢Gregorian months EnglishArabic-Easternmonths: "gulf"
ar-ILArabic (Israel)يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر٢٧ يناير ٢٠٢٢Gregorian months EnglishArabic-Easternmonths: "gulf"
ar-IQArabic (Iraq)كانون الثاني، شباط، آذار، نيسان، أيار، حزيران، تموز، آب، أيلول، تشرين الأول، تشرين الثاني، كانون الأول٢٧ كانون الثاني ٢٠٢٢Assyrian MonthsArabic-Easternmonths: "levant"
ar-JOArabic (Jordan)كانون الثاني، شباط، آذار، نيسان، أيار، حزيران، تموز، آب، أيلول، تشرين الأول، تشرين الثاني، كانون الأول٢٧ كانون الثاني ٢٠٢٢Assyrian MonthsArabic-Easternmonths: "levant"
ar-KMArabic (Comoros)يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر٢٧ يناير ٢٠٢٢Gregorian months EnglishArabic-Easternmonths: "gulf"
ar-KWArabic (Kuwait)يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر٢٧ يناير ٢٠٢٢Gregorian months EnglishArabic-Easternmonths: "gulf"
ar-LBArabic (Lebanon)كانون الثاني، شباط، آذار، نيسان، أيار، حزيران، تموز، آب، أيلول، تشرين الأول، تشرين الثاني، كانون الأول٢٧ كانون الثاني ٢٠٢٢Assyrian MonthsArabic-Easternmonths: "levant"
ar-LYArabic (Libya)يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر27 يناير 2022Gregorian months EnglishArabic-Westernmonths: "gulf"
ar-MAArabic (Morocco)يناير، فبراير، مارس، أبريل، ماي، يونيو، يوليوز، غشت، شتنبر، أكتوبر، نونبر، دجنبر27 يناير 2022Gregorian months English VariantArabic-Westernmonths: "morocco"
ar-MRArabic (Mauritania)يناير، فبراير، مارس، إبريل، مايو، يونيو، يوليو، أغشت، شتمبر، أكتوبر، نوفمبر، دجمبر٢٧ يناير ٢٠٢٢Gregorian months English VariantArabic-Easternnot offered (إبريل، أغشت، شتمبر، دجمبر)
ar-OMArabic (Oman)يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر٢٧ يناير ٢٠٢٢Gregorian months EnglishArabic-Easternmonths: "gulf"
ar-PSArabic (Palestine)كانون الثاني، شباط، آذار، نيسان، أيار، حزيران، تموز، آب، أيلول، تشرين الأول، تشرين الثاني، كانون الأول٢٧ كانون الثاني ٢٠٢٢Assyrian MonthsArabic-Easternmonths: "levant"
ar-QAArabic (Qatar)يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر٢٧ يناير ٢٠٢٢Gregorian months EnglishArabic-Easternmonths: "gulf"
ar-SAArabic (Saudi Arabia)محرم، صفر، ربيع الأول، ربيع الآخر، جمادى الأولى، جمادى الآخرة، رجب، شعبان، رمضان، شوال، ذو القعدة، ذو الحجةجمادى الآخرة ١٤٤٣ هـHijri MonthsArabic-Easterncalendar: "h"
ar-SDArabic (Sudan)يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر٢٧ يناير ٢٠٢٢Gregorian months EnglishArabic-Easternmonths: "gulf"
ar-SOArabic (Somalia)يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر٢٧ يناير ٢٠٢٢Gregorian months EnglishArabic-Easternmonths: "gulf"
ar-SSArabic (South Sudan)يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر٢٧ يناير ٢٠٢٢Gregorian months EnglishArabic-Easternmonths: "gulf"
ar-SYArabic (Syria)كانون الثاني، شباط، آذار، نيسان، أيار، حزيران، تموز، آب، أيلول، تشرين الأول، تشرين الثاني، كانون الأول٢٧ كانون الثاني ٢٠٢٢Assyrian MonthsArabic-Easternmonths: "levant"
ar-TDArabic (Chad)يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر٢٧ يناير ٢٠٢٢Gregorian months EnglishArabic-Easternmonths: "gulf"
ar-TNArabic (Tunisia)جانفي، فيفري، مارس، أفريل، ماي، جوان، جويلية، أوت، سبتمبر، أكتوبر، نوفمبر، ديسمبر27 جانفي 2022Gregorian months FrenchArabic-Westernmonths: "maghreb"
ar-YEArabic (Yemen)يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر٢٧ يناير ٢٠٢٢Gregorian months EnglishArabic-Easternmonths: "gulf"
The same table as an image, with the Assyrian-month locales in blue, the French and local variants in red and the Hijri locale in green
The table as published in 2022: blue, Assyrian months; red, French or local names; green, Hijri months; Arabic-Western numbers marked in black.

The default dates are what browsers showed in 2022; newer browsers may differ (for ar-SA the day was not shown). Mauritania's names (إبريل، أغشت، شتمبر، دجمبر) are not one of the choices.

4.8 Time

Type 15:45, 3:15 م, 3:15 pm or 07:05:30; الآن puts in the time now.

الوقت chooses the style: مألوف as people say it, with the descriptive part of the day (ليلًا، فجرًا، صباحًا، ظهرًا، عصرًا، مساءً); دقيق the exact minutes with only صباحًا (1:00–11:59) and مساءً (12:01–23:59), and ظهرًا at 12:00; 24 ساعة the 24-hour clock as in flight schedules (no part of the day); and مدة a length of time, which may be more than 23 hours.
From 0:01 to 0:59 every clock style says «بعد منتصف الليل», and 0:00 is «منتصف الليل».

A whole hour has no «تمامًا».
خيارات الوقت (collapsed): the part of the day, the seconds, the word «الساعة» at the start and, for «مألوف» only, أجزاء الساعة: off by default, so 13:35 is «الواحدة وخمس وثلاثون دقيقة ظهرًا»; on, it is «الواحدة والنصف وخمس دقائق ظهرًا» (والربع، والثلث، والنصف، إلا الربع; «والنصف إلا خمس دقائق» for :25).

«صيغ أخرى» shows the other forms.
Each line in batch is one time.

For developers: arqamAR.toTime("13:35", {timeParts: "on"}); see 12.18.

13:35→الساعة الواحدة وخمس وثلاثون دقيقةً ظهرًامألوف (default)
13:35→الساعة الواحدة والنصف وخمس دقائق ظهرًامألوف, أجزاء الساعة on
13:35→الساعة الواحدة وخمس وثلاثون دقيقةً مساءًدقيق
13:35→الساعة الثالثة عشرة وخمس وثلاثون دقيقةً24 ساعة
0:25→الساعة الثانية عشرة وخمس وعشرون دقيقةً بعد منتصف الليلafter midnight
2:30→ساعتان ونصفمدة
07:05:30→الساعة السابعة وخمس دقائق وثلاثون ثانيةً صباحًاseconds

The four clock forms. Words in blue are those that differ between the four forms of the same row; words in black are shared by all four. Shown without tashkeel so they read easily.

Time«مألوف» – parts offdefault«مألوف» – parts ontimeParts: "on"«دقيق»timeStyle: "exact"«24 ساعة»timeStyle: "h24"
0:00منتصف الليلمنتصف الليلمنتصف الليلمنتصف الليل
0:03الساعة الثانية عشرة وثلاث دقائق بعد منتصف الليلالساعة الثانية عشرة وثلاث دقائق بعد منتصف الليلالساعة الثانية عشرة وثلاث دقائق بعد منتصف الليلالساعة الثانية عشرة وثلاث دقائق بعد منتصف الليل
0:25الساعة الثانية عشرة وخمس وعشرون دقيقةً بعد منتصف الليلالساعة الثانية عشرة والنصف إلا خمس دقائق بعد منتصف الليلالساعة الثانية عشرة وخمس وعشرون دقيقةً بعد منتصف الليلالساعة الثانية عشرة وخمس وعشرون دقيقةً بعد منتصف الليل
0:30الساعة الثانية عشرة وثلاثون دقيقةً بعد منتصف الليلالساعة الثانية عشرة والنصف بعد منتصف الليلالساعة الثانية عشرة وثلاثون دقيقةً بعد منتصف الليلالساعة الثانية عشرة وثلاثون دقيقةً بعد منتصف الليل
0:45الساعة الثانية عشرة وخمس وأربعون دقيقةً بعد منتصف الليلالساعة الواحدة إلا الربع بعد منتصف الليلالساعة الثانية عشرة وخمس وأربعون دقيقةً بعد منتصف الليلالساعة الثانية عشرة وخمس وأربعون دقيقةً بعد منتصف الليل
1:00الساعة الواحدة ليلًاالساعة الواحدة ليلًاالساعة الواحدة صباحًاالساعة الواحدة
1:15الساعة الواحدة وخمس عشرة دقيقةً ليلًاالساعة الواحدة والربع ليلًاالساعة الواحدة وخمس عشرة دقيقةً صباحًاالساعة الواحدة وخمس عشرة دقيقةً
3:40الساعة الثالثة وأربعون دقيقةً فجرًاالساعة الرابعة إلا الثلث فجرًاالساعة الثالثة وأربعون دقيقةً صباحًاالساعة الثالثة وأربعون دقيقةً
5:20الساعة الخامسة وعشرون دقيقةً فجرًاالساعة الخامسة والثلث فجرًاالساعة الخامسة وعشرون دقيقةً صباحًاالساعة الخامسة وعشرون دقيقةً
7:00الساعة السابعة صباحًاالساعة السابعة صباحًاالساعة السابعة صباحًاالساعة السابعة
7:05الساعة السابعة وخمس دقائق صباحًاالساعة السابعة وخمس دقائق صباحًاالساعة السابعة وخمس دقائق صباحًاالساعة السابعة وخمس دقائق
11:59الساعة الحادية عشرة وتسع وخمسون دقيقةً صباحًاالساعة الثانية عشرة إلا دقيقة صباحًاالساعة الحادية عشرة وتسع وخمسون دقيقةً صباحًاالساعة الحادية عشرة وتسع وخمسون دقيقةً
12:00الساعة الثانية عشرة ظهرًاالساعة الثانية عشرة ظهرًاالساعة الثانية عشرة ظهرًاالساعة الثانية عشرة
12:01الساعة الثانية عشرة ودقيقة ظهرًاالساعة الثانية عشرة ودقيقة ظهرًاالساعة الثانية عشرة ودقيقة مساءًالساعة الثانية عشرة ودقيقة
13:35الساعة الواحدة وخمس وثلاثون دقيقةً ظهرًاالساعة الواحدة والنصف وخمس دقائق ظهرًاالساعة الواحدة وخمس وثلاثون دقيقةً مساءًالساعة الثالثة عشرة وخمس وثلاثون دقيقةً
15:00الساعة الثالثة عصرًاالساعة الثالثة عصرًاالساعة الثالثة مساءًالساعة الخامسة عشرة
16:50الساعة الرابعة وخمسون دقيقةً عصرًاالساعة الخامسة إلا عشر دقائق عصرًاالساعة الرابعة وخمسون دقيقةً مساءًالساعة السادسة عشرة وخمسون دقيقةً
18:00الساعة السادسة مساءًالساعة السادسة مساءًالساعة السادسة مساءًالساعة الثامنة عشرة
19:45الساعة السابعة وخمس وأربعون دقيقةً مساءًالساعة الثامنة إلا الربع مساءًالساعة السابعة وخمس وأربعون دقيقةً مساءًالساعة التاسعة عشرة وخمس وأربعون دقيقةً
23:58الساعة الحادية عشرة وثمان وخمسون دقيقةً مساءًالساعة الثانية عشرة إلا دقيقتين مساءًالساعة الحادية عشرة وثمان وخمسون دقيقةً مساءًالساعة الثالثة والعشرون وثمان وخمسون دقيقةً

The part of the day by style (timePeriod, on by default; «مدة» has none):

From – to«مألوف» (both forms)«دقيق»«24 ساعة»
0:00منتصف الليلمنتصف الليلمنتصف الليل
0:01 – 0:59بَعْدَ مُنْتَصَفِ اللَّيْلِبَعْدَ مُنْتَصَفِ اللَّيْلِبَعْدَ مُنْتَصَفِ اللَّيْلِ
1:00 – 2:59لَيْلًاصَبَاحًا—
3:00 – 5:59فَجْرًاصَبَاحًا—
6:00 – 11:59صَبَاحًاصَبَاحًا—
12:00ظُهْرًاظُهْرًا—
12:01 – 14:59ظُهْرًامَسَاءً—
15:00 – 17:59عَصْرًامَسَاءً—
18:00 – 23:59مَسَاءًمَسَاءً—

4.9 Fractions

Type 3/4, 3 1/2, 3½ or ¾.

الكسر chooses the form: مألوفة the fraction nouns from a half to a tenth (نصف، ثلث، ربع … عشر; ثلثان; ثلاثة أرباع) and «أجزاء من» above a tenth, أجزاء always «… أجزاء من …», and رياضية as in a maths class («ثلاثة على أربعة»).
خيارات الكسور: an improper fraction as a whole number and a fraction (on), and simplify first (off).

A fraction typed in «عملات» or «وحدات قياس» is written with that currency or unit: an amount in its minor unit when exact (as on cheques), a unit with the fraction word.

3/4→ثلاثة أرباعمألوفة
3 ½→ثلاثة ونصفa mixed number
7/12→سبعة أجزاء من اثني عشرabove tenths
3/4→ثلاثة على أربعةرياضية
11/4→اثنان وثلاثة أرباعimproper
2 ½ QAR→ريالان قطريان اثنان، وخمسون درهمًاamount: the minor unit
3 ½ كم→ثلاثة كيلومترات ونصفunit

5. Options

Every option has a ? with live examples.
The examples below use 1234.56 and the Qatari riyal unless stated, without vowel marks so they read easily.

5.1 Tashkeel (vowel marks)

Full tashkeel→أَلْفٌ، وَمِائَتَانِ وَأَرْبَعَةٌ وَثَلَاثُونَ رِيَالًا قَطَرِيًّا، وَسِتَّةٌ وَخَمْسُونَ دِرْهَمًا
Partial (word endings)→ألفٌ، ومائتانِ وَأربعةٌ وَثلاثونَ ريالًا قطريًا، وَستةٌ وَخمسونَ درهمًا
Without tashkeel→ألف، ومائتان وأربعة وثلاثون ريالا قطريا، وستة وخمسون درهما
Fatha tanween only→ألف، ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا
Tanween alif only→ألف، ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا
Full tanween→ألفٌ، ومائتان وأربعةٌ وثلاثون ريالًا قطريًا، وستةٌ وخمسون درهمًا

Fatha tanween on the alif writes «ريالاً» instead of «ريالًا»:

off→واحد وعشرون ريالًا قطريًا
on→واحد وعشرون ريالاً قطرياً

5.2 Ierab (grammatical case)

Nominative (الرفع)→ألف، ومائتان وأربعة وثلاثون ريالا قطريا، وستة وخمسون درهما
Accusative (النصب)→ألف، ومائتين وأربعة وثلاثين ريالا قطريا، وستة وخمسين درهما
Genitive (الجر)→ألف، ومائتين وأربعة وثلاثين ريالا قطريا، وستة وخمسين درهما

5.3 Miscellaneous

5.4 Legal mode

Accounting and legal writing repeats the word «ألف» after the hundreds so that «ثلاثمائة وألفان» cannot be read as 302 or 3,002.
It removes the ambiguity when hundreds are followed by one or two: 302,000 is written «ثلاثمائة ألف وألفان» (three hundred thousand and two thousand) rather than «ثلاثمائة وألفان».

Auto applies it only when needed; All numbers whenever there are hundreds.

302000 — non-legal→ثلاثمائة وألفان
302000 — auto→ثلاثمائة ألف وألفان
1200 — all numbers→ألف، ومائتان

5.5 Number in brackets, and the currency sign

The amount in figures is written in brackets after or before the words, with the currency sign in one of three forms: the ISO code (QAR), the local symbol (ر.ق.), or the currency name in words.
The fraction in the brackets is padded to the currency's places (1,234.00) unless "force decimals" is switched off.

after the words→ألف، ومائتان وأربعة وثلاثون ريالا قطريا، وستة وخمسون درهما (1,234.56 QAR)
before the words→(1,234.56 QAR) ألف، ومائتان وأربعة وثلاثون ريالا قطريا، وستة وخمسون درهما
sign: currency symbol→ألف، ومائتان وأربعة وثلاثون ريالا قطريا، وستة وخمسون درهما (1,234.56 ر.ق.)
sign: currency name→ألف، ومائتان وأربعة وثلاثون ريالا قطريا، وستة وخمسون درهما (1,234.56 ريالا قطريا)

The bracket shape (round, square, curly…) is chosen in the same group. Output number separators change the thousands and decimal separators inside the brackets, e.g. the French form:

1234.56→ألف، ومائتان وأربعة وثلاثون ريالا قطريا، وستة وخمسون درهما (1 234,56 QAR)

5.6 Currency options

5.7 Numbering system (scale)

The difference starts at a thousand million:

2,000,000,000 — Arabic→ملياران
2,000,000,000 — short→بليونان
1,000,000,000,000 — Arabic→تريليون
1,000,000,000,000 — long→بليون

5.8 Decimal formats (numbers only)

Word (Juz/Wa) Word→اثنا عشر، وخمسة وسبعون جزءا من المائة
Word (Juz) Number→اثنا عشر، وخمسة وسبعون جزءا من الـ100
Number (Juz) Word→اثنا عشر، و75 جزءا من المائة
Number (Juz) Number→اثنا عشر، و75 من الـ100
Word-Fasila-Number→اثنا عشر، فاصلة 75
Word-and-Decimal→اثنا عشر، و0.75
Word-and-Fraction→اثنا عشر، و75/100
Word-Fasila-Digit→اثنا عشر، فاصلة سبعة، خمسة
Word-Fasila-Word→اثنا عشر، فاصلة خمسة وسبعون

«من المائة» without the definite article:

12.75→اثنا عشر، وخمسة وسبعون جزءا من مائة
. A zero after the decimal point is read:
12.05→اثنا عشر، فاصلة صفر خمسة
.

5.9 Decimal options: rounding and places

By default extra digits are cut; the rounding option rounds them (half up) and carries into the whole number:

2.675 QAR — no rounding→ريالان قطريان اثنان، وسبعة وستون درهما
2.675 QAR — rounding on→ريالان قطريان اثنان، وثمانية وستون درهما
3.14159 with 2 places→ثلاثة، وأربعة عشر جزءا من المائة

5.10 Max decimal places

There is no limit on the length of a number or on its decimals: any length is written.
أقصى خانات الكسر (Max decimal places) is empty by default, so every decimal is written.

Type a number of places to cut the rest, without rounding: with 2, 3.14159 is written to the hundredths, and 3.146 as 3.14.
To round instead, turn on تقريب الكسور الزائدة (Round extra decimals), just below the field: with 2, 3.146 is then written as 3.15.

For currencies the fraction always follows the currency's own places, so the field is off there.

5.11 Save, Defaults, Search

حفظ (Save) keeps all options in the browser so they come back as you left them; الأصلية (Defaults) restores the originals.
The search box at the top of the panel shows the group containing the typed word (e.g. قوسين, tanween).

5.12 Reading order

ترتيب القراءة (collapsed, below the case): من الأكبر, the largest part first (the default), or من الأصغر, the smallest part first, as classical writers read numbers: units and tens, then hundreds, then thousands.
Each group keeps its own word (ألف، مليون), the comma stays between groups, and the currency name comes after the last, largest part and takes its form («ألفُ ريالٍ»).

Numbers below 100 and ordinals do not change, and legal mode has no effect.
In dates the year follows the same order, and with «سنة» it takes the feminine number («سنة ست وعشرين وألفين»).

1250→ألف ومائتان وخمسون ريالًا قطريًاlargest first (default)
1250→خمسون ومائتان وألف ريال قطريsmallest first
1250.125→خمسون ومائتان وألف دينار كويتي، وخمسة وعشرون ومائة فلسthe fils too
1234567→سبعة وستون وخمسمائة، وأربعة وثلاثون ألفًا ومائتا ألف ومليونnumbers only
1003→ثلاث وألف ليرة سوريةfeminine currency
99→تسعة وتسعون ريالًا سعوديًاbelow 100: no change
18/11/2026→الثامن عشر من شهر نوفمبر سنة ست وعشرين وألفين ميلاديةdate, «سنة»

5.13 Approximate quantities

الكمية التقريبية (collapsed, below the reading order) writes the number approximately when the exact figure is not the point: قرابة / نحو, ما يزيد على, أقلّ من, ما لا يقل عن, ما لا يزيد على, بضعة (three to nine) and نيّف (one to nine above a round number).
The row below chooses the word of «قرابة»: قرابة, نحو, زهاء or حوالَيْ.

العدد كما هو (Exact number) is the default.

After «قرابة» or a phrase such as «ما يزيد على» the number is genitive («قرابةُ ألفِ ريالٍ»).
«بضعة» and «نيّف» take whole numbers only and leave out the figure in brackets; for a number they cannot take, such as 150 with «بضعة», the box shows a short hint instead of the words.

«اشرح» explains every approximate word.
For developers: 12.24.

1000→قرابة ألف درهم إماراتيقرابة
1000→نَحْوَ أَلْفِ دِرْهَمٍ إِمَارَاتِيٍّنحو, accusative, full tashkeel
1000000→ما يزيد على مليون دولار أمريكيما يزيد على
100→أقل من مائة دولار أمريكيأقلّ من
2000→ما لا يقل عن ألفي دولار أمريكيما لا يقل عن
5000→بضعة آلاف جنيه مصريبضعة, thousands
5→بضع ليرات تركيةبضع, a feminine noun
500→بضع مئات من الدراهم المغربيةبضع, hundreds
25→نيف وعشرون درهمًا مغربيًانيّف
103→مائة درهم مغربي ونيفنيّف after a hundred

5.14 Region and time zone

The chip المنطقة in the top bar (in all three (3) display modes) and the group المنطقة والتوقيت at the top of the Options panel choose one of the twenty-two (22) Arab League countries.
A region sets five (5) things on the page: the currency, the month names (أسماء الشهور), the digits (أرقام عربية مشرقية), the two (2) separators, and the time zone of a date with a time.

It is the library's locale (12.25, where the table of the 22 regions is) applied to the page's own controls, so «سريع», «احترافي», «مستندات» and batch conversion all follow it.
The list shows each country with its capital and its offset from Greenwich today.

No region («بلا منطقة») is the start: the page works as before (US dollar, Gulf month names, Arabic-Western numbers).
Choosing «بلا منطقة» later keeps the values on the page as they are.

Tags. Each value set by the region carries a green tag من المنطقة.
A value you change yourself (another currency, the digits switch, a separator) gets an amber tag يدويًا and is kept when you choose another region.

استعادة إعدادات المنطقة (in the chip's list and in the Options group) puts the region's values back.

First visit. When the device's time zone belongs to an Arab country, one line under the top bar offers that country's settings: نعم applies them, لا، شكرًا closes the offer.
It is asked once.

The page reads the time zone the browser already knows; nothing is sent over the network.

A date with a time. In the date type, or in «سريع» where it is detected as تاريخ ووقت, type an ISO date with a time: 2026-11-23T19:30Z, 2026-11-23T22:30:00+03:00, 2026-11-23 22:30 or the compact 20261124T061500Z; or press الآن in the date row for this moment.
A row appears with التوقيت (توقيت منطقتي; كما كُتب في المدخل; the 22 Arab countries; 35 world cities, the airline hubs; غرينتش) and اسم التوقيت (المدينة, the default; الدولة; غرينتش; المدينة وغرينتش; بدون).

A time typed without Z or an offset is written as typed and never named, because the page cannot know where it was meant.
With no region, «توقيت منطقتي» writes the time as typed, named by its offset.

«للمطورين» shows the toDateTime() call.

Saved. The region, your own values and the zone choices are saved in the browser at once; الأصلية (Defaults) removes them.

1250.5→ألف ومائتان وخمسون دينارًا أردنيًا، وخمسمائة فلس (١٬٢٥٠٫٥٠٠ JOD)region Jordan: dinars, Arabic-Eastern numbers
1250.5→ألف ومائتان وخمسون درهمًا مغربيًا، وخمسون سنتيمًا (1.250,50 MAD)region Morocco: the separators 1.250,50
1250.5→ألف ومائتان وخمسون ريالًا قطريًا، وخمسون درهمًا (1,250.50 QAR)region Kuwait, the currency changed by hand («يدويًا»)
15/08/2026→الخامس عشر من شهر غشت لعام ألفين وستة وعشرين للميلادregion Morocco: its month names
2026-11-23T19:30:00Z→الثالث والعشرون من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد، الساعة العاشرة وثلاثون دقيقةً مساءً بتوقيت الدوحةregion Qatar: تاريخ ووقت
2026-11-23T19:30:00Z→الثالث والعشرون من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد، الساعة السابعة وثلاثون دقيقةً مساءً بتوقيت لندن (غرينتش)التوقيت: لندن; اسم التوقيت: المدينة وغرينتش
2026-11-23T19:30:00Z→الثالث والعشرون من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد، الساعة العاشرة وثلاثون دقيقةً مساءً بتوقيت السعوديةregion Saudi Arabia; اسم التوقيت: الدولة
2026-11-23T19:30:00Z→الثالث والعشرون من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد، الساعة السابعة وثلاثون دقيقةً مساءً بتوقيت غرينتشno region: as typed, named by its offset
2026-11-23 22:30→الثالث والعشرون من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد، الساعة العاشرة وثلاثون دقيقةً مساءًno Z, no offset: as typed, not named

6. Batch conversion

6.1 Input

Input lineOutput line
1250.5 KWDألف ومائتان وخمسون دينارًا كويتيًا، وخمسمائة فلس
USD 99تسعة وتسعون دولارًا أمريكيًا
-45 USDسالب خمسة وأربعين دولارًا أمريكيًا
15%خمسة عشر بالمائة
0.5 BTCخمسة أجزاء من العشرة من البتكوين
(empty line)(empty line)

6.2 Output

Click the تحويل وإخراج (Output) tab.
Above the result are the column presets:

Currency columns appear in currency mode only.
"Value" is the amount at the currency's places, unrounded (1250.500 for the Kuwaiti dinar), so Excel formulas work on it.

Numbers are right-aligned in their cells.
Your choice is remembered for the next visit.

The other types work in batch too: ordinals (one rank per line) and dates (one date per line).

7. Copy and export

Single conversion

Batch

A small message at the bottom of the screen confirms every copy and download.

8. Recent conversions, search, dark mode

9. FAQ

Questions about using the page.
For more than 200 questions about the library, with examples, see chapter 13.

Why is 2.675 riyals written "sixty-seven dirhams", not "sixty-eight"?
Because the default is to cut, not round: digits beyond the dirham's two places are dropped. Switch the "rounding" option on if you want rounding.
I typed 1e6 and nothing appeared.
Scientific notation is not accepted; type 1000000.
1250.5 Kuwaiti dinars came out as "five hundred fils" — isn't that a lot?
The dinar has 1000 fils, so half a dinar is five hundred fils. Currencies use their official places (ISO 4217).
Does the image keep the tashkeel colours?
Yes. The image, like the page, draws each colour's marks first and the words on top, so every mark keeps its colour and sits where it belongs.
Are my settings kept if I open the page in another browser?
No; they are saved in that browser on that device.
How do I get back to the original settings?
"الأصلية" (Defaults) in the options panel, then "حفظ" (Save) if you want to keep them.

10. Reference tables

Generated by the engine itself; the last column has full tashkeel.

10.1 Zero to ten

NumberPlainWith tashkeel
0صفرصِفْرٌ
1واحدوَاحِدٌ
2اثناناثْنَانِ
3ثلاثةثَلَاثَةٌ
4أربعةأَرْبَعَةٌ
5خمسةخَمْسَةٌ
6ستةسِتَّةٌ
7سبعةسَبْعَةٌ
8ثمانيةثَمَانِيَةٌ
9تسعةتِسْعَةٌ
10عشرةعَشْرَةٌ

10.2 11 to 19

NumberPlainWith tashkeel
11أحد عشرأَحَدَ عَشَرَ
12اثنا عشراثْنَا عَشَرَ
13ثلاثة عشرثَلَاثَةَ عَشَرَ
14أربعة عشرأَرْبَعَةَ عَشَرَ
15خمسة عشرخَمْسَةَ عَشَرَ
16ستة عشرسِتَّةَ عَشَرَ
17سبعة عشرسَبْعَةَ عَشَرَ
18ثمانية عشرثَمَانِيَةَ عَشَرَ
19تسعة عشرتِسْعَةَ عَشَرَ

10.3 20 to 29

NumberPlainWith tashkeel
20عشرونعِشْرُونَ
21واحد وعشرونوَاحِدٌ وَعِشْرُونَ
22اثنان وعشروناثْنَانِ وَعِشْرُونَ
23ثلاثة وعشرونثَلَاثَةٌ وَعِشْرُونَ
24أربعة وعشرونأَرْبَعَةٌ وَعِشْرُونَ
25خمسة وعشرونخَمْسَةٌ وَعِشْرُونَ
26ستة وعشرونسِتَّةٌ وَعِشْرُونَ
27سبعة وعشرونسَبْعَةٌ وَعِشْرُونَ
28ثمانية وعشرونثَمَانِيَةٌ وَعِشْرُونَ
29تسعة وعشرونتِسْعَةٌ وَعِشْرُونَ

10.4 Hundreds

NumberPlainWith tashkeel
100مائةمِائَةٌ
200مائتانمِائَتَانِ
300ثلاثمائةثَلَاثُمِائَةٍ
400أربعمائةأَرْبَعُمِائَةٍ
500خمسمائةخَمْسُمِائَةٍ
600ستمائةسِتُّمِائَةٍ
700سبعمائةسَبْعُمِائَةٍ
800ثمانمائةثَمَانِمِائَةٍ
900تسعمائةتِسْعُمِائَةٍ

10.5 Thousands and millions

NumberPlainWith tashkeel
1000ألفأَلْفٌ
2000ألفانأَلْفَانِ
3000ثلاثة آلافثَلَاثَةُ آلَافٍ
10000عشرة آلافعَشْرَةُ آلَافٍ
11000أحد عشر ألفاأَحَدَ عَشَرَ أَلْفًا
100000مائة ألفمِائَةُ أَلْفٍ
101000مائة وألفمِائَةٌ وَأَلْفٌ
200000مائتا ألفمِائَتَا أَلْفٍ
1000000مليونمِلْيُونٌ
2000000مليونانمِلْيُونَانِ
3000000ثلاثة ملايينثَلَاثَةُ مَلَايِينَ
1000000000مليارمِلْيَارٌ
2000000000مليارانمِلْيَارَانِ
1000000000000تريليونتِرِيلْيُونٌ

10.6 Masculine and feminine

Three to ten take the opposite gender of the counted noun; one and two agree with it; in 11–19 the first part agrees and «عشرة/عشر» stays opposite; from 20 the tens do not change:

NumberFeminine noun (ليرة)Masculine noun (دينار)
1ليرة واحدةدينار واحد
2ليرتان اثنتانديناران اثنان
3ثلاث ليراتثلاثة دنانير
10عشر ليراتعشرة دنانير
11إحدى عشرة ليرةأحد عشر دينارا
12اثنتا عشرة ليرةاثنا عشر دينارا
20عشرون ليرةعشرون دينارا
21إحدى وعشرون ليرةواحد وعشرون دينارا

10.7 «مئة» in the Quran

The Quran writes «مِئَة» without the alif; the common modern spelling is «مِائَة».
Both are correct; the option "Ma'ah / Miah" chooses between them.

مئة in the Quran

11. Glossary

Major / minor unit
The riyal and its dirham, the dinar and its fils. Each currency has a number of places for its minor unit (usually 2 or 3).
Demonym (الصفة)
The country adjective: قطري Qatari, كويتي Kuwaiti. Removed by "without the country name".
Tashkeel (التشكيل)
The vowel marks on the letters. "Full" marks every letter; "partial" only word endings; "tanween only" just the tanween marks.
Tanween (التنوين)
A final -n sound written as a doubled mark: ريالٌ (-un), ريالًا (-an), ريالٍ (-in). The -an form usually needs an alif: ريالًا.
Iʿrāb: nominative, accusative, genitive (الرفع، النصب، الجر)
The grammatical case of the noun in the sentence; it changes word endings: ألفان/ألفين, عشرون/عشرين.
Scale (المرتبة)
Thousand, million, billion…; the numbering system changes the names above a thousand million.
Legal form (الصيغة القانونية)
Repeating «ألف» after the hundreds to avoid ambiguity in financial documents.
Cut versus round
Cutting drops extra places; rounding raises them when the next digit is five or more. The library rounds by default, as Intl does; rounding: "off" cuts.
Canonical number
What the engine accepts: Arabic-Western numbers with one decimal point. The page converts what you type into it.

12. The arqam library

The page is built on a library, arqamAR, which you can use in your own web pages, servers and scripts.
It is the same engine as the page, so it writes the same words: pure JavaScript, no dependencies, no network, about 100 KB.

This chapter shows every method, every option and every form of input, each with its result.
Every example on this page was produced by running the library.

Internals and maintenance are in docs/DEVELOPER.md.

12.0 The library and its language engines

Arqam comes in two parts:

Arabic is the default, so arqam and arqamAR give the same Arabic result, and every example in this manual works with either name.

You call it as arqam(number); arqam.toWords(number) is the same function under its longer name, and this manual uses the short one.
The number can be a string, a JavaScript number, or a BigInt for very large whole numbers.

arqam("1250")
→ألف ومائتان وخمسون
a string
arqam(1250)
→ألف ومائتان وخمسون
a number
arqam(12345678901234567890n)
→اثنا عشر كوينتليونًا وثلاثمائة وخمسة وأربعون كوادرليونًا وستمائة وثمانية وسبعون تريليونًا وتسعمائة مليار ومليار ومائتان وأربعة وثلاثون مليونًا وخمسمائة وسبعة وستون ألفًا وثمانمائة وتسعون
a BigInt: beyond a JavaScript number's exact range
arqam(1250.5, {currency: "QAR"})
→ألف ومائتان وخمسون ريالًا قطريًا، وخمسون درهمًا
with a currency

If you already use JavaScript's Intl.NumberFormat, arqam() and arqam.NumberFormat will feel familiar: they take the same kind of arguments.
To get English instead of Arabic, pass an English locale such as en-GB.

arqam("1250", "en-GB")
→"One Thousand Two Hundred and Fifty"
arqam("1250.50", "en-GB", {currency: "QAR"})
→"One Thousand Two Hundred and Fifty Qatari Riyals and Fifty Dirhams"

Some topics have their own manuals:

Object.getPrototypeOf(arqam) === arqamAR
→true
arqam.toBilingual("1250.50", "QAR").en
→"One Thousand Two Hundred and Fifty Qatari Riyals and Fifty Dirhams Only"

12.1 Files and how to load them

FileWhat it isUse it for
dist/arqamAR.mjsES module: default export arqam (the library; also the named export arqam), the named export arqamAR (its Arabic engine), and named exports toWords, toParts, toDate, toTime, toFraction, createArqam, config, registerCurrency, reset, options, version, currenciesbrowsers (served over http), Node, Deno, bundlers
dist/arqamAR.d.mtsTypeScript declarations: every option with its values, the currency attributes, the partseditors and TypeScript projects (found automatically)
dist/arqamExplain.d.mtsTypeScript declarations of explain(), explainDate(), explainTime(), explainFraction(), explainRange() and their result (each word, its part and rules)TypeScript projects using arqam/explain
dist/arqamUnits.mjsthe units add-on: 252 units of measure for arqam.NumberFormat style "unit", by their Intl names, keys or Arabic names; src/arqamUnits.js is the same as a plain script, loaded after src/arqamAR.jsimport "arqam/units", only when style "unit" is used
dist/SRI.txtsha384 integrity hashespinning a CDN file
src/arqamAR.jsthe same engine as a plain script: two globals: arqam, the library, and arqamAR, its Arabic engine, with every method and property (there are no named exports)pages opened from disk (file://), like Arqam's own page
src/the library source, as plain scripts : arqamAR.js, arqamWordsToNumbers.js, arqamExplain.js and arqamUnits.js; dist/ is built from them. Copy the ones you need next to your pageediting the library; plain-script pages

From npm (the package arqam, version 2: version 1.1.2 was an earlier library; the package is published when Mohsen decides), from the files in dist/ on GitHub, or from arqampro.net/download:

npm install arqam
import arqam, {toWords, toDate, createArqam} from "arqam";   // the Arabic words
import arqamEN from "arqam/en";                                   // the English words

In a web page served over http(s):

<p id="words" dir="rtl"></p>
<script type="module">
  import arqam from "./dist/arqamAR.mjs";        // or a versioned CDN path: https://cdn.example.com/arqam/1.85/arqamAR.mjs
  document.querySelector("#words").textContent = arqam("1234.56", {currency: "SAR"});
</script>

Browsers do not load modules from a page opened from disk.
For such a page, use the plain script:

<script src="arqamAR.js"></script>
<script>
  document.querySelector("#words").textContent = arqam("1234.56", {currency: "AED"});
</script>

In Node, Deno and TypeScript:

// Node (ES module, .mjs or "type": "module") and Deno
import arqam, {toWords, toParts, registerCurrency} from "./dist/arqamAR.mjs";
// Node (CommonJS): require() is not supported; use a dynamic import
const {default: arqam} = await import("./dist/arqamAR.mjs");   // inside an async function
// TypeScript: dist/arqamAR.d.mts beside the module is found automatically
import arqam, {type ArqamOptions, type ArqamParts} from "./dist/arqamAR.mjs";
const opts: ArqamOptions = {currency: "USD", tashkeel: "full"};        // a misspelt option or a bad value is a compile error

To pin a CDN file, take its hash from dist/SRI.txt: <link rel="modulepreload" href="…/arqamAR.mjs" integrity="sha384-…" crossorigin="anonymous">.
Show the words in an element with dir="rtl", especially when they hold figures or Latin letters (the amount in brackets).

12.2 Quick start

The calls and options used most, on one printable page: the cheat sheet.

The default is numbers mode with the tanween alif (ريالًا), in the nominative case; a call that wants other marks says so, e.g. tashkeel: "full" or tashkeel: "none":

arqam("1234.56")
→ألف ومائتان وأربعة وثلاثون، وستة وخمسون جزءًا من المائة
arqam("1234.56", {currency: "QAR"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا
arqam("1234.56", {currency: "QAR", tashkeel: "full"})
→أَلْفٌ وَمِائَتَانِ وَأَرْبَعَةٌ وَثَلَاثُونَ رِيَالًا قَطَرِيًّا، وَسِتَّةٌ وَخَمْسُونَ دِرْهَمًا
arqam.config({currency: "KWD"})standing options for the calls that follow
arqam("2.5")
→ديناران كويتيان، وخمسمائة فلس
arqam("-25%")
→سالب خمسة وعشرين بالمائة
arqam("11", {ordinal: "feminine"})
→الحادية عشرة
arqam.toDate("18/11/2026", {calendar: "b", style: "compact"})
→18 نوفمبر 2026م، الموافق 8 جمادى الآخرة 1448هـ
arqam.toTime("15:45")
→الساعة الثالثة وخمس وأربعون دقيقةً عصرًا
arqam.toFraction("3 1/2")
→ثلاثة دنانير كويتية، وخمسمائة فلس

12.3 toWords(number, [code | options])

arqam(number)                    // -> string, with the standing options
arqam(number, {currency: "EGP"})             // the 2nd parameter as text: a currency code, for this call only
arqam(number, {currency: code, ...})       // an options object, for this call only
arqam([n1, n2, ...], options)    // -> an array of strings, in order
arqam("2500.35", {currency: "QAR"})
→ألفان وخمسمائة ريال قطري، وخمسة وثلاثون درهمًا
arqam("2500.35", {currency: "USD"})
→ألفان وخمسمائة دولار أمريكي، وخمسة وثلاثون سنتًا
arqam(["22", "0.55", "1.6"], {currency: "DZD"})
→اثنان وعشرون دينارًا جزائريًاخمسة وخمسون سنتيمًا جزائريًادينار جزائري، وستون سنتيمًا
each number reads as in a call of its own
arqam(["1", "2", "3"], {currency: "SYP"})
→ليرة سوريةليرتان سوريتانثلاث ليرات سورية

A one-off option does not stick:

arqam.config({currency: "QAR"})
arqam("30")
→ثلاثون ريالًا قطريًا
arqam("20", {currency: "USD"})
→عشرون دولارًا أمريكيًا
this call only
arqam("30")
→ثلاثون ريالًا قطريًا
back to riyals

12.4 toParts(number, [code | options])

The same conversion as toWords(), returned in its parts, so you can lay them out yourself (an invoice with the riyals and the dirhams in separate cells, the sign in red…).
It takes the same parameters; an array gives an array of results.

arqam.toParts("-1250.5", {currency: "QAR", brackets: "end", prefix: "فقط", suffix: "لا غير"})
→
textفقط سالب ألف ومائتين وخمسين ريالًا قطريًا، وخمسين درهمًا لا غير (-1,250.50 QAR)
validtrue
negativetrue
percentfalse
ordinal""
prefixفقط
signسالب
wholeألف ومائتين وخمسين ريالًا قطريًا
fraction، وخمسين درهمًا
suffixلا غير
brackets"(-1,250.50 QAR)"
figure"-1,250.50 QAR"
FieldMeaning
textthe words, exactly as toWords() gives them
validfalse when the number could not be written (text is then the isNaN option)
negative percent ordinalwhat kind of number it was
prefix suffixthe words before and after, as written
sign«سالب» for a negative amount, else ""
wholethe whole part with its currency name; all the words of a percentage or an ordinal
fractionthe fraction with its joiner («، وخمسون درهما»)
brackets figurethe brackets as written, and their content

Without colours the parts rebuild the text: [prefix, [sign, whole + fraction].join(" "), suffix] joined by spaces (empty parts left out), with the brackets before or after.
More: 12.16.

arqam.toParts(["0.5", "25%", "x"], {currency: "QAR"})
→
textخمسون درهمًا قطريًا
validtrue
negativefalse
percentfalse
ordinal""
prefix""
sign""
whole""
fractionخمسون درهمًا قطريًا
suffix""
brackets""
figure""
textخمسة وعشرون بالمائة
validtrue
negativefalse
percenttrue
ordinal""
prefix""
sign""
wholeخمسة وعشرون بالمائة
fraction""
suffix""
brackets""
figure""
text""
validfalse
negativefalse
percentfalse
ordinal""
prefix""
sign""
whole""
fraction""
suffix""
brackets""
figure""
below one there is no whole part; a percentage is all in whole; "x" is not valid

12.5 config(options)

Sets standing options: every later call uses them until they change.
It is the fastest way to convert many numbers with the same settings.

Options are checked by name and value before any is applied; a mistake throws a TypeError and changes nothing:

arqam.config({currency: "KWD"})
arqam("3")
→ثلاثة دنانير كويتية
arqam.config({currency: "QAR", tashkel: "f"})
→TypeError: arqamAR: unknown option "tashkel"; did you mean "tashkeel"?
arqam("3")
→ثلاثة دنانير كويتية
still dinars: nothing was applied
arqam.config({tashkeel: "x"})
→TypeError: arqamAR: tashkeel must be one of "none" or "n", "alif" or "a", "fatha" or "h", "tanween" or "t", "endings" or "p", "full" or "f", "" (got "x")
arqam.config({compact: "yes"})
→TypeError: arqamAR: compact must be "on" or "off" (got "yes")
arqam.config({compact: true})switches also take true and false
arqam("1234567")
→مليون و234 ألفًا و567 دينارًا كويتيًا

Instances: createArqam(options)

config() changes the options of the one shared arqamAR.
When two parts of a page, two modules or two users of a server need different settings, give each its own instance.

An instance starts from the defaults (not from the global options), has the same calls (toWords, toParts, toDate, toTime, toFraction, config, options, reset, registerCurrency), and nothing it does reaches the global object or another instance.
Currencies added with registerCurrency() are shared by all.

A call through an instance costs about 20 µs more.

const kw = arqam.createArqam({currency: "KWD"}), sy = arqam.createArqam({currency: "SYP", tashkeel: "full"})
arqam.config({currency: "QAR"})
kw.toWords("2.5")
→ديناران كويتيان، وخمسمائة فلس
sy.toWords("3")
→ثَلَاثُ لِيرَاتٍ سُورِيَّةٍ
arqam("2.5")
→ريالان قطريان، وخمسون درهمًا
the global object keeps its own options
kw.config({wordOrder: "small"})
kw.toWords("1250")
→خمسون ومائتان وألف دينار كويتي
arqam("1250")
→ألف ومائتان وخمسون ريالًا قطريًا
unchanged
kw.options().currency
→"KWD"

When code changes, custom names given with an earlier code are cleared unless they are given again in the same call.

12.6 registerCurrency(code, attributes)

Adds a currency (or any counted noun) to the table for the session, or modifies one.
It returns a copy of the stored row.

A new code needs majorSingle and majorPlural; a singular and its plural are always given together, because a plural cannot be guessed safely (أغورة → أغورات, not أغورةات).

AttributeMeaningExample
currDecimaldecimal places, 0–18 (default 2)3
majorSingle / majorPluralthe main unit, singular and pluralريال / ريالات
majorSingleC / majorPluralCits adjective, singular and plural (optional)قطري / قطرية
minorSingle / minorPluralthe minor unit (optional)درهم / دراهم
minorSingleC / minorPluralCits adjective (usually empty)
the eight names + Tthe same names with full tashkeel, for tashkeel:"f" (a name without its T form is used as it is)majorSingleT: "رِيَال"
majorGender / minorGender0 masculine (default), 1 feminine: 3 to 10 take the opposite gender1
symbolLatin / symbolNativeEnglish and Native, the signs for the brackets (numSymbol "english" / "native")QR / ر.ق.
symbol (sign)Symbol, one Unicode character, for numSymbol "sign" (12.11.1); "" removes it"\u20C1"
openDecimalsdecimals written as given (crypto); with currDecimal 0, any number of decimalstrue
qualifier / qualifierTa fixed phrase after the number word, never declined, repeated after the minor unitفي الساعة
idafa / idafaTthe second term of an iḍāfa, right after the noun: the noun loses its tanween and the dual its nūnشاي
countrythe place name: the adjective (majorSingleC) is made from it with nisba(), unless given; the plural adjective by the rule, + ةعمان
arqam.registerCurrency("ZZO", {majorSingle: "ريال", majorPlural: "ريالات", country: "عمان"}) && arqam("3", {currency: "ZZO"})
→ثلاثة ريالات عمانية
arqam.registerCurrency("ZZZ", { // the number currDecimal: 2, // the names, without tashkeel majorSingle: "كوكو", majorPlural: "كوكوات", majorSingleC: "مابتواني", majorPluralC: "مابتوانية", minorSingle: "كاكا", minorPlural: "كاكات", // the symbols symbolNative: "ك" }).length
→21
arqam("2500.35", {currency: "ZZZ"})
→ألفان وخمسمائة كوكو مابتواني، وخمسة وثلاثون كاكا
arqam("7.5", {currency: "ZZZ", brackets: "end", numSymbol: "symbol"})
→سبعة كوكوات مابتوانية، وخمسون كاكا (7.50 ك)

State the gender of a feminine noun, or the numbers 3 to 10 come out wrong:

arqam.registerCurrency("LRA", {majorSingle: "ليرة", majorPlural: "ليرات", minorSingle: "قرش", minorPlural: "قروش"})&&""
→""
arqam("3.5", {currency: "LRA"})
→ثلاثة ليرات، وخمسون قرشًا
✗ ليرة is feminine
arqam.registerCurrency("LRA", {majorSingle: "ليرة", majorPlural: "ليرات", majorGender: 1})&&""
→""
arqam("3.5", {currency: "LRA"})
→ثلاث ليرات، وخمسون قرشًا
✓

An existing code is modified; only the attributes given change:

arqam.registerCurrency("QAR", {majorSingle: "ريال", majorPlural: "ريالات", majorSingleT: "رِيَال", majorPluralT: "رِيَالَاتٍ"})&&""
→""
arqam("7.5", {currency: "QAR", tashkeel: "full"})
→سَبْعَةُ رِيَالَاتٍ قَطَرِيَّةٍ، وَخَمْسُونَ دِرْهَمًا

Mistakes are refused with a TypeError that says what is wrong:

arqam.registerCurrency("NEW", {majorSingle: "x"})
→TypeError: arqam.registerCurrency: a new currency needs majorSingle and majorPlural
arqam.registerCurrency("NEW", {majorSingle: "x", majorPlural: "y", minorSingle: "z"})
→TypeError: arqam.registerCurrency: minorSingle and minorPlural must be given together
arqam.registerCurrency("NEW", {majorSingle: "x", majorPlural: "y", majorGender: 2})
→TypeError: arqam.registerCurrency: majorGender must be 0 (masculine) or 1 (feminine)
arqam.registerCurrency("NEW", {majorSingle: "x", majorPlural: "y", colour: "red"})
→TypeError: arqam.registerCurrency: unknown attribute "colour"; use: currDecimal, majorSingle, majorSingleC, majorPlural, majorPluralC, minorSingle, minorSingleC, minorPlural, minorPluralC, majorSingleT, majorSingleCT, majorPluralT, majorPluralCT, minorSingleT, minorSingleCT, minorPluralT, minorPluralCT, majorGender, minorGender, symbolLatin, symbolNative, openDecimals, qualifier, qualifierT, idafa, idafaT, country, symbol
arqam.registerCurrency("Z1", {})
→TypeError: arqam.registerCurrency: the code must be 3 to 8 letters or digits starting with a letter, e.g. "ZZZ" or "E01"

12.7 reset(), options(), defaults, version, currencies

On arqamAR, in the plain script and the module :

arqam.version
→"1.85"
Object.keys(arqam.currencies).length
→188
the currency table (read it; change it with registerCurrency)
arqam.config({tashkeel: "full", currency: "QAR"})
arqam.options().tashkeel
→"f"
a copy of the current options
arqam.defaults.tashkeel
→""
the defaults
arqam.reset()back to the defaults (registered currencies stay)
arqam.options().tashkeel + " " + JSON.stringify(arqam.options().currency)
→" \"\""
JSON.stringify(arqam.optionNames.legal)
→{"none":"n","auto":"a","full":"f"}
the readable name of each short code (all in 12.10.1)

removeTashkeel(text, [options])

Any Arabic text without its tashkeel: the vowels, tanween, shadda, sukun, the dagger alif, the Quranic signs and the marks of the Arabic Extended-A block, 113 marks.
Hamza above and below stay (they make أ and إ in decomposed text) unless hamza: "on", which removes the hamza from the alif only: آ أ إ ٱ become ا, and ؤ ئ ء stay; tatweel ـ stays unless tatweel: "on".

An array gives an array.
It is on arqamAR, on every instance, and in arqamWordsToNumbers too.

It is Mohsen Alyafei's removeTashkeelAll (2021) with the marks it missed added.

arqam.removeTashkeel("حِسَابٌ وَحِسَابًا مِنْ ثَلَاثُمِئَةِ رِيَالٍ قَطَرِيٍّ")
→حساب وحسابا من ثلاثمئة ريال قطري
arqam.removeTashkeel("بِسْمِ ٱللَّٰهِ ٱلرَّحْمَٰنِ ٱلرَّحِيمِ")
→بسم ٱلله ٱلرحمن ٱلرحيم
ٱ is a letter
arqam.removeTashkeel("بـــسَــم", {tatweel: "on"})
→بسم
arqam.removeTashkeel(arqam("1250.5", {currency: "MAD", tashkeel: "full"}))
→ألف ومائتان وخمسون درهما مغربيا، وخمسون سنتيما
JSON.stringify(arqam.removeTashkeel(["مِائَةٌ", "أَلْفٌ"]))
→["مائة","ألف"]

nisba(name, [options])

The نسبة adjective of a place name: Mohsen Alyafei's stringSifah, checked and completed. الـ and ـة go, ـيا and ـا become ـي, ـواي becomes ـواني, a name in ـي stays, otherwise ي is added; «جزر X» gives the adjective of X, «X الشمالية» gives «Xي شمالي», and a few names have their own adjective (النمسا: نمساوي، بيرو: بيروفي).
{feminine: true} gives the feminine.

Plain letters out.
registerCurrency() uses it for country.

arqam.nisba("قطر")
→قطري
arqam.nisba("المغرب")
→مغربي
arqam.nisba("سوريا")
→سوري
arqam.nisba("أمريكا")
→أمريكي
arqam.nisba("أوروغواي")
→أوروغواني
arqam.nisba("كوريا الشمالية")
→كوري شمالي
arqam.nisba("جنوب أفريقيا")
→جنوب أفريقي
arqam.nisba("جزر القمر")
→قمري
arqam.nisba("النمسا")
→نمساوي
arqam.nisba("كوريا الشمالية", {feminine: true})
→كورية شمالية

12.8 The number you pass

Pass amounts as text: it keeps every digit.
JS numbers are accepted too, but a JS number holds only about 16 significant digits.

arqam("1234.56")
→ألف ومائتان وأربعة وثلاثون، وستة وخمسون جزءًا من المائة
arqam("١٢٣٤.٥٦")
→ألف ومائتان وأربعة وثلاثون، وستة وخمسون جزءًا من المائة
Arabic-Eastern numbers
arqam(".5")
→خمسة أجزاء من العشرة
arqam("007")
→سبعة
arqam("-250")
→سالب مائتين وخمسين
negative
arqam("25%")
→خمسة وعشرون بالمائة
percentage
arqam("-12.05%")
→سالب اثني عشر فاصلة صفر خمسة بالمائة
arqam(12.5)
→اثنا عشر، وخمسة أجزاء من العشرة
a JS number
arqam(1e21)
→سكستليون
exponent: written out in full
arqam(-5)
→سالب خمسة
arqam(10n ** 30n)
→نونليون
BigInt
arqam(0.1 + 0.2)
→ثلاثة أجزاء من العشرة
a JS number keeps its float error: pass text

Not accepted (the result is the isNaN option, default ""): thousands separators, a comma as the decimal mark, spaces, exponents in text, several points, letters.
Normalise what the user typed first (recipe in 12.16):

arqam("1,234")
→""
arqam("12,5", {isNaN: "خطأ"})
→خطأ
arqam("1e6")
→""
arqam(null)
→""

No limits. A number may have any number of digits, and any number of decimals, with no option needed.
The scale names have no end, in every scale: after the 999th -illion come ملينيليون (10^3003), مليمليون (10^3006) and so on.

The engine builds its scale tables as far as each number needs.
toWords rounds the decimals as Intl does (3 places for a number); maximumFractionDigits keeps as many as you give (any whole number), and decRound cuts at its number.

arqam("1" + "0".repeat(3003))
→ملينيليون
arqam("0." + "0".repeat(4000) + "5", {maximumFractionDigits: 4001})
→خمسة أجزاء من المائة مليديوتريجنتاتريسنتليون
arqam("1" + "0".repeat(312), {tashkeel: "full"})
→تِرِيسْسِنْتِلْيُونٌ

12.9 Errors and strict

By default a number that cannot be written returns isNaN.
With strict: "on" the library throws instead, so a bad number cannot slip through: a TypeError for the wrong form or type, a RangeError for a number out of range.

Option mistakes always throw.

arqam("12,5", {strict: "on"})
→TypeError: arqam.toWords: "12,5" is not a number in the form 1234.56 (digits, an optional ".", and "-" before or "%" after)
arqam({}, {strict: "on"})
→TypeError: arqam.toWords: the number must be text, a number or a BigInt (got object)
arqam(Infinity, {strict: "on"})
→RangeError: arqam.toWords: Infinity cannot be written in words
arqam("1" + "0".repeat(3003), {strict: "on"})
→ملينيليون
arqam("0", {ordinal: "masculine", strict: "on"})
→RangeError: arqam.toWords: an ordinal must be a whole number from 1 to 999,999
arqam("3", {tashkel: "f"})
→TypeError: arqam.toWords: unknown option "tashkel"; did you mean "tashkeel"?
arqam("3", {decSubInParts: "on"})
→TypeError: arqam.toWords: the option "decSubInParts" is not an option; give the currency a qualifier with registerCurrency()
try {
  amountCell.textContent = arqam(input, {currency: "QAR", strict: "on"});
} catch (e) {
  if (e instanceof RangeError) showMessage("The number is out of range: " + e.message);
  else if (e instanceof TypeError) showMessage("Not a number: " + e.message);
}

12.10 All the options

Each option, its values (default first) and an example.
A coded value has a readable name and a short code: tashkeel: "full" and tashkeel: "f" are the same; both are shown as "full"/"f", and every value is explained in 12.10.1 below.

The examples use the default, the tanween alif (ريالًا), except where the option is about tashkeel.
The page's option names are listed in chapter 5.

OptionValuesEffectExample
currency
""default
a code
numbers, or the currency of an amount (built in or registered, any letter case; Intl's name); on its own it makes the number an amount"1234.56", {currency: "SAR"}
ألف ومائتان وأربعة وثلاثون ريالًا سعوديًا، وست وخمسون هللةً
emphasisOneTwo
""default
"on"
"off"
«واحد/اثنان» after the counted noun: none by default, but in the legal and cheque forms · always · never"2", {currency: "QAR"}
ريالان قطريان
tashkeel
"alif"or "a" or ""default
"none"or "n"
"full"or "f"
"endings"or "p"
"tanween"or "t"
"fatha"or "h"
tanween on an alif ending only (the default) · none · full marks on every letter · tanween and word endings · all tanween · fatha tanween"1234.56", {currency: "AED", tashkeel: "full"}
أَلْفٌ وَمِائَتَانِ وَأَرْبَعَةٌ وَثَلَاثُونَ دِرْهَمًا إِمَارَاتِيًّا، وَسِتَّةٌ وَخَمْسُونَ فِلْسًا
ierab
"raf"or "r"default
"nasb"or "n"
"jarr"or "j"
nominative · accusative · genitive (12.14)"2000", {currency: "USD", ierab: "nasb"}
ألفي دولار أمريكي
legal
"auto"or "a" or ""default
"none"or "n"
"full"or "f"
legal form: hundreds followed by 1 or 2 only (the default) · none · every group with hundreds"302000", {legal: "none"}
ثلاثمائة وألفان
scale
"arabic"default
"short"
"long"
مليار · بليون · long scale"2000000000", {scale: "short"}
بليونان
brackets
""default
"end"
"start"
"decimals"
the figure in brackets after or before the words; or the fraction in brackets"1234.56", {currency: "EGP", brackets: "end"}
ألف ومائتان وأربعة وثلاثون جنيهًا مصريًا، وستة وخمسون قرشًا (1,234.56 EGP)
bracketsType
""default
"[]"
"{}"
"«»"
…
the bracket characters"1234.56", {currency: "MAD", brackets: "end", bracketsType: "[]"}
ألف ومائتان وأربعة وثلاثون درهمًا مغربيًا، وستة وخمسون سنتيمًا [1,234.56 MAD]
numSymbol
"code"or "i"default
"english"or "latin" or "l"
"native"or "symbol" or "s"
"sign"or "g"
"name"or "c"
"none"or "sub"
or a symbol
in the brackets: ISO code · English (QR) · Native (ر.ق.) · Symbol (⃁, €, $; 12.11.1) · the currency's name · the figure only; an empty sign falls back (12.11.1)"1234.56", {currency: "QAR", brackets: "end", numSymbol: "native"}
ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا (1,234.56 ر.ق.)
currDecForce
"on"default
"off"
the figure shows the currency's places (1,234.00)"1234", {currency: "QAR", brackets: "end", currDecForce: "off"}
ألف ومائتان وأربعة وثلاثون ريالًا قطريًا (1,234 QAR)
arabicNumbers
"off"default
"on"
"western"
"eastern"
Arabic-Eastern numbers in the brackets instead of Arabic-Western numbers, with the Arabic separators (unless sepDecimal or sepThousands is given): the Arabic decimal separator (٫ / U+066B): used in formal and typeset Arabic numbers, e.g. ٣٫١; the Arabic thousands separator (٬ / U+066C): groups large numbers into thousands, e.g. ١٬٠٠٠٬٠٠٠"1234.56", {currency: "QAR", brackets: "end", arabicNumbers: "on"}
ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا (١٬٢٣٤٫٥٦ QAR)
sepThousands
""default
a character or a locale
the thousands separator in the brackets only"1234.56", {currency: "SAR", brackets: "end", sepThousands: "'"}
ألف ومائتان وأربعة وثلاثون ريالًا سعوديًا، وست وخمسون هللةً (1'234.56 SAR)
sepDecimal
""default
a character or a locale
the decimal separator in the brackets only; give sepThousands with it"1234.56", {currency: "SAR", brackets: "end", sepThousands: " ", sepDecimal: ","}
ألف ومائتان وأربعة وثلاثون ريالًا سعوديًا، وست وخمسون هللةً (1 234,56 SAR)
prefix
""default
text
words before the words; «فقط» makes the cheque form"1234.56", {currency: "AED", prefix: "فقط"}
فقط ألف ومائتان وأربعة وثلاثون درهمًا إماراتيًا، وستة وخمسون فلسًا
suffix
""default
text
words after the words; «لا غير» makes the cheque form"1234.56", {currency: "AED", suffix: "لا غير"}
ألف ومائتان وأربعة وثلاثون درهمًا إماراتيًا، وستة وخمسون فلسًا لا غير
compact
"off"default
"on"
groups as figures, scale words in letters"1234567.56", {currency: "USD", compact: "on"}
مليون و234 ألفًا و567 دولارًا أمريكيًا، و56 سنتًا
comma
"off"default
"on"
the Arabic comma before و between groups; off by default"1234.56", {currency: "QAR", comma: "on"}
ألف، ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا
miah
"on"default
"off"
مائة or مئة"300", {miah: "off"}
ثلاثمئة
miahSplit
"off"default
"on"
ثلاث مائة written apart"300", {miahSplit: "on"}
ثلاث مائة
tanweenAlif
"off"default
"on"
tanween on the letter before the alif (ريالاً)"21", {currency: "QAR", tashkeel: "alif", tanweenAlif: "on"}
واحد وعشرون ريالاً قطرياً
addZero
"off"default
"on"
صفر before a fraction of one"0.5", {addZero: "on"}
صفر، وخمسة أجزاء من العشرة
decFormat
"auto"or ""default
"words"or "w"
"figures"or "n"
"digits"or "sw"
"words-words"or "ww"
"words-figures"or "wn"
"figures-words"or "nw"
"figures-figures"or "nn"
"decimal"or "d"
"slash"or " or "
the fraction's form (12.13)"12.75", {decFormat: "figures-figures"}
اثنا عشر، و75 من الـ100
decJuz
"on"default
"off"
the word جزء in fractions"12.75", {decJuz: "off"}
اثنا عشر، وخمسة وسبعون من المائة
decAL
"on"default
"off"
من المائة or من مائة"12.75", {decAL: "off"}
اثنا عشر، وخمسة وسبعون جزءًا من مائة
decFaslah
"off"default
"on"
فاصلة instead of و before the fraction"12.75", {decFaslah: "on"}
اثنا عشر، فاصلة خمسة وسبعون جزءًا من المائة
decIgnore
"off"default
"on"
the whole part only"1234.56", {currency: "QAR", decIgnore: "on"}
ألف ومائتان وأربعة وثلاثون ريالًا قطريًا
decRound
""default
a number
decimal places kept, cut; with it there is no rounding as Intl ("": maximumFractionDigits decides)"3.14159", {decRound: 2}
ثلاثة، وأربعة عشر جزءًا من المائة
rounding
""default
"on"
"off"
an amount's extra places: rounded half up (as toWords does by default) or cut"2.675", {currency: "QAR", rounding: "off"}
ريالان قطريان، وسبعة وستون درهمًا
ignoreCountry
"off"default
"on"
ريال instead of ريال قطري"1234.56", {currency: "QAR", ignoreCountry: "on"}
ألف ومائتان وأربعة وثلاثون ريالًا، وستة وخمسون درهمًا
percent
"off"default
"on"
a percentage (also "25%")"12.5", {percent: "on"}
اثنا عشر فاصلة خمسة بالمائة
ordinal
""default
"masculine"or "m"
"feminine"or "f"
the ordinal, masculine or feminine, 1–999,999"11", {ordinal: "feminine"}
الحادية عشرة
wordOrder
""default
"large"
"small"
the largest part first (default) or the smallest, as in classical Arabic (12.14)"1250", {currency: "QAR", wordOrder: "small"}
خمسون ومائتان وألف ريال قطري
approx
""default
"about"
"over"
"under"
"atLeast"
"atMost"
"few"
"plus"
an approximate quantity: قرابة، ما يزيد على، أقلّ من، ما لا يقل عن، ما لا يزيد على، بضعة، نيّف (12.24)"5000", {currency: "EGP", approx: "few"}
بضعة آلاف جنيه مصري
approxWord
"qurabah"default
"nahw"
"zuhaa"
"hawali"
the word of approx "about": قرابة (default), نحو، زهاء، حوالَيْ"20", {approx: "about", approxWord: "nahw"}
نحو عشرين
approxRound
""default
a number
with approx: round first to this many significant digits"987450", {currency: "QAR", approx: "about", approxRound: 1}
قرابة مليون ريال قطري
errorLanguage
""default
"en"
"ar"
the language of the error messages: English (the default) or Arabic; the English text stays in error.english"20", {errorLanguage: "ar"}
عشرون
locale
""default
"ar-QA"
…
"ar-KM"
the region: its currency, month names, digits, separators and time zone, for every method (12.25)"1500.5", {locale: "ar-KW", brackets: "end"}
ألف وخمسمائة، وخمسة أجزاء من العشرة (1,500.5)
timeZone
""default
"asWritten"
"local"
an IANA name
the clock of an exact moment (ISO with Z or an offset, or a Date) in toTime, toDate and toDateTime (12.25)arqam.toTime("2026-11-24T07:30:00Z", {timeZone: "Asia/Qatar"})
الساعة العاشرة وثلاثون دقيقةً صباحًا بتوقيت الدوحة
zoneName
""default
"city"
"country"
"offset"
"both"
"off"
how the zone is named after the time: بتوقيت الدوحة (12.25)arqam.toTime("2026-11-24T07:30:00Z", {timeZone: "Asia/Qatar", zoneName: "city"})
الساعة العاشرة وثلاثون دقيقةً صباحًا بتوقيت الدوحة
strict
"off"default
"on"
throw instead of returning isNaN (12.9)"12,5", {strict: "on"}
TypeError: arqam.toWords: "12,5" is not a number in the form 1234.56 (digits, an optional ".", and "-" before or "%" after)
isNaN
""default
any value
returned for a number that cannot be written"12,5", {isNaN: "—"}
"—"
zeroWords
""default
text
the words of a zero amount instead of «صفر ريال»: «لا شيء» on some cheques"0", {currency: "QAR", zeroWords: "لا شيء"}
لا شيء
split
"off"default
"on"
colour markers in the words (12.15)"1234.56", {currency: "QAR", split: "on"}
ألف|p و|مائتان وأربعة وثلاثون |cريالًا قطريًا|p، و|f||f|ستة وخمسون |cدرهمًا
currDecimal, majorSingle…
names for a one-off currency in the same call (registerCurrency is the better way)"2.5", { currency: "ZZZ", currDecimal: 2, majorSingle: "كوكو", majorPlural: "كوكوات", minorSingle: "كاكا", minorPlural: "كاكات" }
كوكوان، وخمسون كاكًا

12.10.1 Every coded value: name, short code, meaning

Six options take coded values.
Each value has a readable name and a short code, and both may be used, in any letter case: {tashkeel: "full"}, {tashkeel: "Full"} and {tashkeel: "f"} give the same words.

options() and defaults always show the short code.
arqam.optionNames gives the table of names and codes.

A value that is neither is refused with a TypeError that lists every value with its name.
The words below are the engine's own output; words in blue differ from those of the default value (the first row).

Not in these tables: scale ("arabic", "short", "long", or "a", "s", "l"), brackets ("end", "start", "decimals", or "e", "s", "d") and wordOrder ("large", "small"), which have always had readable names, and the switches, which take "on"/"off" or true/false.

JSON.stringify(arqam.optionNames.tashkeel)
→{"none":"n","alif":"a","fatha":"h","tanween":"t","endings":"p","full":"f"}
arqam("5", {tashkeel: "Full"}) === arqam("5", {tashkeel: "f"})
→true
arqam.config({tashkeel: "endings", ierab: "nasb"})
arqam.options().tashkeel + arqam.options().ierab
→"pn"
stored as the short codes
arqam.reset()
arqam("5", {legal: "off"})
→TypeError: arqam.toWords: legal must be one of "none" or "n", "auto" or "a", "full" or "f", "" (got "off")
not a value: "none" is the same

tashkeel

NameShort codeMeaningExample "1234.56", {currency: "QAR", ierab: "nasb"}
"alif" default"a"tanween only on a word ending in alif: ريالًا (the default)ألفًا ومائتين وأربعة وثلاثين ريالًا قطريًا، وستة وخمسين درهمًا
"none""n"no marks at allألفا ومائتين وأربعة وثلاثين ريالا قطريا، وستة وخمسين درهما
"fatha""h"every fatha tanween (the accusative): ريالًا، أربعةًألفًا ومائتين وأربعةً وثلاثين ريالًا قطريًا، وستةً وخمسين درهمًا
"tanween""t"all three tanween: ألفٌ، ريالًا، درهمٍألفًا ومائتين وأربعةً وثلاثين ريالًا قطريًا، وستةً وخمسين درهمًا
"endings""p"the tanween and the vowel on the last letter of every wordألفًا ومائتينِ وَأربعةً وَثلاثينَ ريالًا قطريًّا، وَستةً وَخمسينَ درهمًا
"full""f"every letter (the page's default)أَلْفًا وَمِائَتَيْنِ وَأَرْبَعَةً وَثَلَاثِينَ رِيَالًا قَطَرِيًّا، وَسِتَّةً وَخَمْسِينَ دِرْهَمًا

ierab

NameShort codeMeaningExample "2003", {currency: "QAR", tashkeel: "full"}
"raf" default"r"nominative (مرفوع), the default: the amount is the subject: المبلغُ ألفا ريالٍأَلْفَانِ وَثَلَاثَةُ رِيَالَاتٍ قَطَرِيَّةٍ
"nasb""n"accusative (منصوب): دفعتُ ألفي ريالٍأَلْفَيْنِ وَثَلَاثَةَ رِيَالَاتٍ قَطَرِيَّةٍ
"jarr""j"genitive (مجرور): بمبلغ ألفي ريالٍأَلْفَيْنِ وَثَلَاثَةِ رِيَالَاتٍ قَطَرِيَّةٍ

legal

NameShort codeMeaningExample "305102000"
"auto" default"a"the scale word after hundreds followed by 1 or 2 only (مائة ألف وألف), the defaultثلاثمائة وخمسة ملايين ومائة ألف وألفان
"none""n"the shortest form (مائة وألف)ثلاثمائة وخمسة ملايين ومائة وألفان
"full""f"the scale word after the hundreds of every groupثلاثمائة مليون وخمسة ملايين ومائة ألف وألفان

numSymbol

NameShort codeMeaningExample "1234.5", {currency: "QAR", brackets: "end"}
"code" default"i"the ISO code, the defaultألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وخمسون درهمًا (1,234.50 QAR)
"english""l"English: the sign in Latin letters (QR); none: Native, then the ISO codeألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وخمسون درهمًا (1,234.50 QR)
"native""s"Native: the sign in the country's own script (ر.ق.); none: English, then the ISO codeألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وخمسون درهمًا (1,234.50 ر.ق.)
"sign""g"Symbol: one Unicode character (SAR ⃁, EUR €, USD $; 12.11.1); none: Native, then the ISO codeألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وخمسون درهمًا (1,234.50 ر.ق.)
"symbol""s"the same as nativeألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وخمسون درهمًا (1,234.50 ر.ق.)
"latin""l"the same as englishألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وخمسون درهمًا (1,234.50 QR)
"name""c"the currency's nameألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وخمسون درهمًا (1,234.50 ريالًا قطريًا)
"none""sub"the figure onlyألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وخمسون درهمًا (1,234.50)

decFormat

NameShort codeMeaningExample "12.05"
"auto" default""the default: for numbers as words-words, for money as wordsاثنا عشر، وخمسة أجزاء من المائة
"words""w"فاصلة and the decimals in words; money: the minor unit in wordsاثنا عشر، فاصلة صفر خمسة
"figures""n"فاصلة and the decimals in figures; money: the minor unit in figuresاثنا عشر، فاصلة 05
"digits""sw"فاصلة and each digit as a wordاثنا عشر، فاصلة صفر، خمسة
"words-words""ww"parts: top in words, bottom in wordsاثنا عشر، وخمسة أجزاء من المائة
"words-figures""wn"parts: top in words, bottom in figuresاثنا عشر، وخمسة أجزاء من الـ100
"figures-words""nw"parts: top in figures, bottom in wordsاثنا عشر، و5 أجزاء من المائة
"figures-figures""nn"top in figures, bottom in figuresاثنا عشر، و5 من الـ100
"decimal""d"the decimal as written (0.05)اثنا عشر، و0.05
"slash""/"a fraction with a slash (5/100)اثنا عشر، و5/100

ordinal

NameShort codeMeaningExample "21"
(not given) default""a cardinal numberواحد وعشرون
"masculine""m"the masculine ordinal: الحادي والعشرونالحادي والعشرون
"feminine""f"the feminine ordinal: الحادية والعشرونالحادية والعشرون

12.10.2 currency

12.10 Options › currency

numbers, or the currency of an amount (built in or registered, any letter case; Intl's name); on its own it makes the number an amount

Format

arqam(number, {currency: value})
new arqam.NumberFormat("ar", {currency: value}).format(number)
arqam.config({currency: value})
Values"" | a code
Default""
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

The currency of an amount, by its ISO 4217 code (Intl's name for it).
On its own it makes the number an amount; "" writes a plain number.

Any of the 188 codes of the table, or one added with registerCurrency(), in any letter case.

Purpose and when to use it

  • Cheques, invoices and contracts: the amount with its currency and its minor unit.
  • A count of things: a unit of measure or a noun registered as a currency (كوب ماء، كيلومتر).

Values

ValueMeaning
"" defaultnumbers, or the currency of an amount (built in or registered, any letter case; Intl's name); on its own it makes the number an amount
a code

Examples

An amount
arqam("1234.56", {currency: "SAR"})
→ألف ومائتان وأربعة وثلاثون ريالًا سعوديًا، وست وخمسون هللةً
Any letter case
arqam("75", {currency: "kwd"})
→خمسة وسبعون دينارًا كويتيًا
A plain number
arqam("1234.56", {currency: ""})
→ألف ومائتان وأربعة وثلاثون، وستة وخمسون جزءًا من المائة
A unit registered as a currency
arqam("12.5", {currency: "KWD", ignoreCountry: "on"})
→اثنا عشر دينارًا، وخمسمائة فلس
The minor unit alone
arqam("0.75", {currency: "QAR"})
→خمسة وسبعون درهمًا قطريًا
An unknown code: the nearest is suggested
arqam("5", {currency: "QAT"})
→RangeError: arqam.toWords: unknown currency "QAT" (did you mean "QAR"?): add it with registerCurrency(), or give majorSingle and majorPlural in the same call

Works with

numSymbol, brackets, ignoreCountry, currDecForce, emphasisOneTwo

Notes and rules

  • A currency on its own makes the number an amount (Intl's style "currency" is understood); currency: "" writes a plain number.
  • The code is ISO 4217's (Intl's name). The 188 built-in codes are listed in 12.11; registerCurrency() adds more.
  • The number of places of the minor unit comes from the currency (3 for KWD, 0 for JPY …); the extra places are rounded half up unless rounding is "off".
  • A currency code is an option, never the second argument: arqam("5", "QAR") is a RangeError.

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("1234.56", {currency: "x"})
→RangeError: arqam.toWords: unknown currency "x": add it with registerCurrency(), or give majorSingle and majorPlural in the same call

Related questions

  • Q2 Which file do I load in a web page?
  • Q3 How do I import it as an ES module?
  • Q5 How do I use it in Node.js with require()?
  • Q8 How do I get English words through arqam?
  • Q21 Is there TypeScript support?
  • Q27 Can I use it with Deno or Bun?

See also

numSymbol · brackets · ignoreCountry · currDecForce · emphasisOneTwo

12.10.3 emphasisOneTwo

12.10 Options › emphasisOneTwo

«واحد/اثنان» after the counted noun: none by default, but in the legal and cheque forms · always · never

Format

arqam(number, {emphasisOneTwo: value})
new arqam.NumberFormat("ar", {emphasisOneTwo: value}).format(number)
arqam.config({emphasisOneTwo: value})
Values"" | "on" | "off"
Default""
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

«واحد/اثنان» after the counted noun.
The singular and the dual already say the number, so by default ("") the word is left out (ريالان قطريان), except in the legal form and the cheque form («فقط … لا غير»), where the number is said twice so that it cannot be altered.

Purpose and when to use it

  • Contracts and letters: the default, the noun alone.
  • Cheques: «فقط … لا غير» brings the number in by itself; "on" writes it always, "off" never.

Values

ValueMeaning
"" default«واحد/اثنان» after the counted noun: none by default, but in the legal and cheque forms
"on"always
"off"never

Every value on one example

arqam("2", {currency: "QAR", emphasisOneTwo: ""})
→ريالان قطريان
arqam("2", {currency: "QAR", emphasisOneTwo: "on"})
→ريالان قطريان اثنان
arqam("2", {currency: "QAR", emphasisOneTwo: "off"})
→ريالان قطريان

Examples

The default
arqam("2", {currency: "QAR"})
→ريالان قطريان
The default on a cheque
arqam("2", {currency: "QAR", prefix: "فقط", suffix: "لا غير"})
→فقط ريالان قطريان اثنان لا غير
The default in the legal form
arqam("1", {currency: "QAR", legal: "auto"})
→ريال قطري واحد
Always
arqam("1", {currency: "QAR", emphasisOneTwo: "on"})
→ريال قطري واحد
Never, even on a cheque
arqam("2", {currency: "QAR", prefix: "فقط", emphasisOneTwo: "off"})
→فقط ريالان قطريان
The minor unit too
arqam("2.02", {currency: "KWD"})
→ديناران كويتيان، وعشرون فلسًا
A feminine noun
arqam("2", {currency: "SYP", emphasisOneTwo: "on"})
→ليرتان سوريتان اثنتان
In the accusative
arqam("1", {currency: "KWD", ierab: "nasb", emphasisOneTwo: "on"})
→دينارًا كويتيًا واحدًا

Works with

legal, prefix, suffix, currency

Notes and rules

  • Only 1 and 2 are affected: from 3 the number comes before the noun (ثلاثة ريالات).
  • A number with no noun (no currency) always keeps «واحد/اثنان».
  • toParts() and formatToParts() have no integer part when the word is left out; the parts still join to the words.
  • The reader reads the noun alone back: arqam.fromWords("ريالان قطريان") gives "2".

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("2", {currency: "QAR", emphasisOneTwo: "x"})
→TypeError: arqam.toWords: emphasisOneTwo must be "" (the default), "on" or "off" (got "x")

Related questions

  • Q378 What does emphasisOneTwo do?
  • Q577 Why does 2 riyals give «ريالان قطريان» without «اثنان»?

See also

legal · prefix · suffix · currency

12.10.4 tashkeel

12.10 Options › tashkeel

tanween on an alif ending only (the default) · none · full marks on every letter · tanween and word endings · all tanween · fatha tanween

Format

arqam(number, {tashkeel: value})
new arqam.NumberFormat("ar", {tashkeel: value}).format(number)
arqam.config({tashkeel: value})
Values"alif" | "none" | "full" | "endings" | "tanween" | "fatha"
Default"alif"
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

The vowel marks on the words: the tanween on an alif ending (the default), as on cheques and in standard written Arabic, none for plain text, the endings only, or full marks for teaching and reading aloud.

Purpose and when to use it

  • Cheques and invoices: "alif" (ريالًا).
  • Teaching and reading aloud: "full"; the marks are always in Unicode's standard order.

Values

ValueOther namesMeaning
"alif" default"a" ""tanween on an alif ending only (the default)
"none""n"none
"full""f"full marks on every letter
"endings""p"tanween and word endings
"tanween""t"all tanween
"fatha""h"fatha tanween

Every value on one example

arqam("1234.56", {currency: "AED", tashkeel: "alif"})
→ألف ومائتان وأربعة وثلاثون درهمًا إماراتيًا، وستة وخمسون فلسًا
arqam("1234.56", {currency: "AED", tashkeel: "none"})
→ألف ومائتان وأربعة وثلاثون درهما إماراتيا، وستة وخمسون فلسا
arqam("1234.56", {currency: "AED", tashkeel: "full"})
→أَلْفٌ وَمِائَتَانِ وَأَرْبَعَةٌ وَثَلَاثُونَ دِرْهَمًا إِمَارَاتِيًّا، وَسِتَّةٌ وَخَمْسُونَ فِلْسًا
arqam("1234.56", {currency: "AED", tashkeel: "endings"})
→ألفٌ ومائتانِ وَأربعةٌ وَثلاثونَ درهمًا إماراتيًّا، وَستةٌ وَخمسونَ فلسًا
arqam("1234.56", {currency: "AED", tashkeel: "tanween"})
→ألفٌ ومائتان وأربعةٌ وثلاثون درهمًا إماراتيًا، وستةٌ وخمسون فلسًا
arqam("1234.56", {currency: "AED", tashkeel: "fatha"})
→ألف ومائتان وأربعة وثلاثون درهمًا إماراتيًا، وستة وخمسون فلسًا

Examples

The tanween alif (the default), as on cheques
arqam("21", {currency: "QAR"})
→واحد وعشرون ريالًا قطريًا
None: plain text
arqam("21", {currency: "QAR", tashkeel: "none"})
→واحد وعشرون ريالا قطريا
The endings only
arqam("21", {currency: "QAR", tashkeel: "endings"})
→واحدٌ وَعشرونَ ريالًا قطريًّا
Full marks
arqam("21", {currency: "QAR", tashkeel: "full"})
→وَاحِدٌ وَعِشْرُونَ رِيَالًا قَطَرِيًّا
With the case
arqam("21", {currency: "QAR", tashkeel: "full", ierab: "jarr"})
→وَاحِدٍ وَعِشْرِينَ رِيَالًا قَطَرِيًّا
Removing the marks again
arqam.removeTashkeel(arqam("21", {currency: "QAR", tashkeel: "full"}))
→واحد وعشرون ريالا قطريا

Works with

ierab, tanweenAlif

Notes and rules

  • The marks are always written in Unicode's standard order (the letter, its vowel, then the shadda), so a search or a comparison finds them.
  • Without tashkeel the alif of the accusative is still written: «خمسة وعشرون جزءا».
  • The short codes ("a", "f", "p" …) and the names are the same; config() and options() give the codes.

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("1234.56", {currency: "AED", tashkeel: "x"})
→TypeError: arqam.toWords: tashkeel must be one of "none" or "n", "alif" or "a", "fatha" or "h", "tanween" or "t", "endings" or "p", "full" or "f", "" (got "x")

Related questions

  • Q21 Is there TypeScript support?
  • Q82 How do I colour the groups and the tanween at the same time?
  • Q83 How do I show the case endings (the last mark of each word) in colour?
  • Q108 How do I give the full-tashkeel forms of a currency I register?
  • Q113 How do I write a currency with tashkeel when I registered it?
  • Q148 Which vowel marks are in the words by default?

See also

ierab · tanweenAlif

12.10.5 ierab

12.10 Options › ierab

nominative · accusative · genitive (12.14)

Format

arqam(number, {ierab: value})
new arqam.NumberFormat("ar", {ierab: value}).format(number)
arqam.config({ierab: value})
Values"raf" | "nasb" | "jarr"
Default"raf"
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

The case of the words: nominative (رفع, the default), accusative (نصب) or genitive (جر), as the place of the number in the sentence asks.

Purpose and when to use it

  • After «دفعتُ» or «بلغ المبلغُ»: nasb or raf.
  • After a preposition (من، إلى، بـ): jarr.

Values

ValueOther namesMeaning
"raf" default"r"nominative
"nasb""n"accusative
"jarr""j"genitive

Every value on one example

arqam("2000", {currency: "USD", ierab: "raf"})
→ألفا دولار أمريكي
arqam("2000", {currency: "USD", ierab: "nasb"})
→ألفي دولار أمريكي
arqam("2000", {currency: "USD", ierab: "jarr"})
→ألفي دولار أمريكي

Examples

Nominative (the default)
arqam("2000", {currency: "QAR"})
→ألفا ريال قطري
Accusative, after «دفعتُ»
arqam("2000", {currency: "QAR", ierab: "nasb", prefix: "دفعتُ"})
→دفعتُ ألفي ريال قطري
Genitive, after a preposition
arqam("2000", {currency: "QAR", ierab: "jarr", prefix: "بمبلغ"})
→بمبلغ ألفي ريال قطري
The case seen in the marks
arqam("12", {currency: "QAR", ierab: "nasb", tashkeel: "full"})
→اثْنَي عَشَرَ رِيَالًا قَطَرِيًّا

Works with

tashkeel (to see the case), prefix

Notes and rules

  • The case changes the duals and the sound plurals (اثنان، اثنين؛ عشرون، عشرين) and the tanween of the accusative.
  • Arqam does not read the sentence: give the case the number has in it (12.14).
  • explain() gives the case of each word and the rule behind it.

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("2000", {currency: "USD", ierab: "x"})
→TypeError: arqam.toWords: ierab must be one of "raf" or "r", "nasb" or "n", "jarr" or "j", "" (got "x")

Related questions

  • Q235 Does an ordinal change in the accusative and the genitive?
  • Q260 How do I write a date after «في» (or «بتاريخ»)?
  • Q261 How do I write «في الساعة العاشرة» or «بعد ساعتين ونصف»?
  • Q342 What does ierab do?
  • Q404 What do utils.toCase(words, ierab) give?
  • Q464 How do I load it?

See also

tashkeel · prefix

12.10 Options › legal

legal form: hundreds followed by 1 or 2 only (the default) · none · every group with hundreds

Format

arqam(number, {legal: value})
new arqam.NumberFormat("ar", {legal: value}).format(number)
arqam.config({legal: value})
Values"auto" | "none" | "full"
Default"auto"
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

The legal form, which cannot be misread on a cheque or in a contract: «مائة ألف وألف» rather than «مائة وألف».
"auto" is the default; "none" turns it off, "full" applies it to every group.

Asked for in the call or in config(), it also brings «واحد/اثنان» after the noun.

Purpose and when to use it

  • Contracts and cheques: "auto".
  • Every group with its hundreds: "full".

Values

ValueOther namesMeaning
"auto" default"a" ""legal form: hundreds followed by 1 or 2 only (the default)
"none""n"none
"full""f"every group with hundreds

Every value on one example

arqam("302000", {legal: "auto"})
→ثلاثمائة ألف وألفان
arqam("302000", {legal: "none"})
→ثلاثمائة وألفان
arqam("302000", {legal: "full"})
→ثلاثمائة ألف وألفان

Examples

Auto (the default)
arqam("101000", {currency: "QAR"})
→مائة ألف وألف ريال قطري
None
arqam("101000", {currency: "QAR", legal: "none"})
→مائة وألف ريال قطري
Full
arqam("305000", {currency: "QAR", legal: "full"})
→ثلاثمائة ألف وخمسة آلاف ريال قطري
A cheque
arqam("2002", {currency: "QAR", legal: "auto", prefix: "فقط", suffix: "لا غير"})
→فقط ألفان وريالان قطريان اثنان لا غير

Works with

emphasisOneTwo, prefix, suffix

Notes and rules

  • The legal form cannot be misread: «مائة ألف وألف» says plainly which group each word belongs to.
  • With legal "auto" or "full", «واحد/اثنان» is written after the noun (emphasisOneTwo).

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("302000", {legal: "x"})
→TypeError: arqam.toWords: legal must be one of "none" or "n", "auto" or "a", "full" or "f", "" (got "x")

Related questions

  • Q200 What is the legal form?
  • Q206 Does legal apply to millions too?
  • Q345 What does legal do?
  • Q462 Is «مائة وألف» 101,000 or 1,100?

See also

emphasisOneTwo · prefix · suffix

12.10.7 scale

12.10 Options › scale

مليار · بليون · long scale

Format

arqam(number, {scale: value})
new arqam.NumberFormat("ar", {scale: value}).format(number)
arqam.config({scale: value})
Values"arabic" | "short" | "long"
Default"arabic"
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

The names of the large numbers: Arabic (مليار), the short scale (بليون = 10^9) or the long scale (بليون = 10^12).

Purpose and when to use it

  • The Gulf and most Arab countries: "arabic".
  • Texts that follow a European usage: "long".

Values

ValueMeaning
"arabic" defaultمليار
"short"بليون
"long"long scale

Every value on one example

arqam("2000000000", {scale: "arabic"})
→ملياران
arqam("2000000000", {scale: "short"})
→بليونان
arqam("2000000000", {scale: "long"})
→ملياران

Examples

Arabic (the default)
arqam("2000000000", {currency: "QAR"})
→مليارا ريال قطري
The short scale
arqam("2000000000", {scale: "short"})
→بليونان
The long scale
arqam("2000000000000", {scale: "long"})
→بليونان
A very large number
arqam("1" + "0".repeat(30))
→نونليون

Works with

compact

Notes and rules

  • There is no limit: after the 999th -illion come ملينيليون (10^3003) and the names go on.
  • «مليار» is 10^9 in the Arabic scale; «بليون» is 10^9 in the short scale and 10^12 in the long scale.

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("2000000000", {scale: "x"})
→TypeError: arqam.toWords: scale must be one of "arabic", "short", "long", "a", "s", "l" (got "x")

Related questions

  • Q198 How is a billion written?
  • Q201 Can I write the groups as figures and only the scale words in letters?
  • Q203 What is the difference between the short and the long scale?
  • Q355 What does scale do?
  • Q405 What do utils.scaleName(power, [options]) give?
  • Q457 Can I read with the long scale?

See also

compact

12.10.8 brackets

12.10 Options › brackets

the figure in brackets after or before the words; or the fraction in brackets

Format

arqam(number, {brackets: value})
new arqam.NumberFormat("ar", {brackets: value}).format(number)
arqam.config({brackets: value})
Values"" | "end" | "start" | "decimals"
Default""
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

The figure in brackets after or before the words, as on cheques; or, with "decimals", the fraction in brackets.

Purpose and when to use it

  • Cheques: "end", the words then the figure.
  • A table of amounts: "start".

Values

Value
"" default
"end"
"start"
"decimals"

Every value on one example

arqam("1234.56", {currency: "EGP", brackets: ""})
→ألف ومائتان وأربعة وثلاثون جنيهًا مصريًا، وستة وخمسون قرشًا
arqam("1234.56", {currency: "EGP", brackets: "end"})
→ألف ومائتان وأربعة وثلاثون جنيهًا مصريًا، وستة وخمسون قرشًا (1,234.56 EGP)
arqam("1234.56", {currency: "EGP", brackets: "start"})
→(1,234.56 EGP) ألف ومائتان وأربعة وثلاثون جنيهًا مصريًا، وستة وخمسون قرشًا
arqam("1234.56", {currency: "EGP", brackets: "decimals"})
→ألف ومائتان وأربعة وثلاثون جنيهًا مصريًا، و(ستة وخمسون قرشًا)

Examples

After the words
arqam("1234.56", {currency: "SAR", brackets: "end"})
→ألف ومائتان وأربعة وثلاثون ريالًا سعوديًا، وست وخمسون هللةً (1,234.56 SAR)
Before the words
arqam("1234.56", {currency: "SAR", brackets: "start"})
→(1,234.56 SAR) ألف ومائتان وأربعة وثلاثون ريالًا سعوديًا، وست وخمسون هللةً
The fraction in brackets
arqam("12.75", {brackets: "decimals"})
→اثنا عشر، (وخمسة وسبعون جزءًا من المائة)
Arabic-Eastern numbers
arqam("1234.56", {currency: "EGP", brackets: "end", arabicNumbers: "eastern"})
→ألف ومائتان وأربعة وثلاثون جنيهًا مصريًا، وستة وخمسون قرشًا (١٬٢٣٤٫٥٦ EGP)
Another bracket
arqam("1234.56", {currency: "SAR", brackets: "end", bracketsType: "[]"})
→ألف ومائتان وأربعة وثلاثون ريالًا سعوديًا، وست وخمسون هللةً [1,234.56 SAR]

Works with

bracketsType, numSymbol, arabicNumbers, sepThousands, sepDecimal, currDecForce

Notes and rules

  • The figure is written as the region writes it (sepThousands, sepDecimal, arabicNumbers), with the currency as numSymbol says.
  • A negative amount keeps its sign in the figure.

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("1234.56", {currency: "EGP", brackets: "x"})
→TypeError: arqam.toWords: brackets must be one of "", "end", "start", "decimals", "e", "s", "d" (got "x")

Related questions

  • Q57 How do I show the words correctly in HTML?
  • Q58 How do I add the amount in figures after the words?
  • Q60 What is toParts() and when do I need it?
  • Q63 What label can appear next to the figure in brackets?
  • Q64 Can the figure in brackets use other separators?
  • Q65 Can the figure in brackets use Arabic-Eastern digits?

See also

bracketsType · numSymbol · arabicNumbers · sepThousands · sepDecimal · currDecForce

12.10.9 bracketsType

12.10 Options › bracketsType

the bracket characters

Format

arqam(number, {bracketsType: value})
new arqam.NumberFormat("ar", {bracketsType: value}).format(number)
arqam.config({bracketsType: value})
Values"" | "[]" | "{}" | "«»"
Default""
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

The bracket characters around the figure: ( ) by default, or [ ], { }, « » and others.

Purpose and when to use it

  • A house style that writes «…».
  • Square brackets in a printed form.

Values

Value
"" default
"[]"
"{}"
"«»"

Every value on one example

arqam("1234.56", {currency: "MAD", brackets: "end", bracketsType: ""})
→ألف ومائتان وأربعة وثلاثون درهمًا مغربيًا، وستة وخمسون سنتيمًا (1,234.56 MAD)
arqam("1234.56", {currency: "MAD", brackets: "end", bracketsType: "[]"})
→ألف ومائتان وأربعة وثلاثون درهمًا مغربيًا، وستة وخمسون سنتيمًا [1,234.56 MAD]
arqam("1234.56", {currency: "MAD", brackets: "end", bracketsType: "{}"})
→ألف ومائتان وأربعة وثلاثون درهمًا مغربيًا، وستة وخمسون سنتيمًا {1,234.56 MAD}
arqam("1234.56", {currency: "MAD", brackets: "end", bracketsType: "«»"})
→ألف ومائتان وأربعة وثلاثون درهمًا مغربيًا، وستة وخمسون سنتيمًا «1,234.56 MAD»

Examples

Round (the default)
arqam("1234.56", {currency: "MAD", brackets: "end"})
→ألف ومائتان وأربعة وثلاثون درهمًا مغربيًا، وستة وخمسون سنتيمًا (1,234.56 MAD)
Square brackets
arqam("1234.56", {currency: "MAD", brackets: "end", bracketsType: "[]"})
→ألف ومائتان وأربعة وثلاثون درهمًا مغربيًا، وستة وخمسون سنتيمًا [1,234.56 MAD]
Braces
arqam("1234.56", {currency: "MAD", brackets: "end", bracketsType: "{}"})
→ألف ومائتان وأربعة وثلاثون درهمًا مغربيًا، وستة وخمسون سنتيمًا {1,234.56 MAD}
Guillemets
arqam("1234.56", {currency: "MAD", brackets: "end", bracketsType: "«»"})
→ألف ومائتان وأربعة وثلاثون درهمًا مغربيًا، وستة وخمسون سنتيمًا «1,234.56 MAD»
Before the words
arqam("1234.56", {currency: "MAD", brackets: "start", bracketsType: "[]"})
→[1,234.56 MAD] ألف ومائتان وأربعة وثلاثون درهمًا مغربيًا، وستة وخمسون سنتيمًا
The fraction in brackets
arqam("12.75", {brackets: "decimals", bracketsType: "[]"})
→اثنا عشر، [وخمسة وسبعون جزءًا من المائة]
With Arabic-Eastern numbers
arqam("1234.56", {currency: "EGP", brackets: "end", bracketsType: "«»", arabicNumbers: "eastern"})
→ألف ومائتان وأربعة وثلاثون جنيهًا مصريًا، وستة وخمسون قرشًا «١٬٢٣٤٫٥٦ EGP»

Works with

brackets

Notes and rules

  • Give the two characters, opening then closing: "[]", "{}", "«»", "<>" or any other pair.
  • It has no effect unless brackets is set.
  • In right-to-left text the browser mirrors ( ) [ ] { } on screen; the characters themselves are not changed.

Related questions

  • Q62 Can I choose the bracket characters?
  • Q350 What does bracketsType do?

See also

brackets

12.10.10 numSymbol

12.10 Options › numSymbol

in the brackets: ISO code · English (QR) · Native (ر.ق.) · Symbol (⃁, €, $; 12.11.1) · the currency's name · the figure only; an empty sign falls back (12.11.1)

Format

arqam(number, {numSymbol: value})
new arqam.NumberFormat("ar", {numSymbol: value}).format(number)
arqam.config({numSymbol: value})
Values"code" | "english" | "native" | "sign" | "name" | "none" | or a symbol
Default"code"
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

How the currency is shown in the figure in brackets: its ISO code (the default), its English or native symbol, its Unicode sign, its name, or nothing.

Purpose and when to use it

  • A bank cheque: the ISO code, never confused.
  • A shop receipt in the region: "native" (ر.ق.) or "sign" (⃁).

Values

ValueOther namesMeaning
"code" default"i"in the brackets: ISO code
"english""latin" "l"English (QR)
"native""symbol" "s"Native (ر.ق.)
"sign""g"Symbol (⃁, €, $; 12.11.1)
"name""c"the currency's name
"none""sub"the figure only; an empty sign falls back (12.11.1)
or a symbol

Every value on one example

arqam("1234.56", {currency: "QAR", brackets: "end", numSymbol: "code"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا (1,234.56 QAR)
arqam("1234.56", {currency: "QAR", brackets: "end", numSymbol: "english"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا (1,234.56 QR)
arqam("1234.56", {currency: "QAR", brackets: "end", numSymbol: "native"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا (1,234.56 ر.ق.)
arqam("1234.56", {currency: "QAR", brackets: "end", numSymbol: "sign"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا (1,234.56 ر.ق.)
arqam("1234.56", {currency: "QAR", brackets: "end", numSymbol: "name"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا (1,234.56 ريالًا قطريًا)
arqam("1234.56", {currency: "QAR", brackets: "end", numSymbol: "none"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا (1,234.56)

Examples

The ISO code (the default)
arqam("1234.56", {currency: "QAR", brackets: "end"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا (1,234.56 QAR)
The English symbol
arqam("1234.56", {currency: "USD", brackets: "end", numSymbol: "english"})
→ألف ومائتان وأربعة وثلاثون دولارًا أمريكيًا، وستة وخمسون سنتًا (1,234.56 USD)
The native symbol
arqam("1234.56", {currency: "QAR", brackets: "end", numSymbol: "native"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا (1,234.56 ر.ق.)
The Unicode sign
arqam("1234.56", {currency: "SAR", brackets: "end", numSymbol: "sign"})
→ألف ومائتان وأربعة وثلاثون ريالًا سعوديًا، وست وخمسون هللةً (1,234.56 ⃁)
The name
arqam("1234.56", {currency: "QAR", brackets: "end", numSymbol: "name"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا (1,234.56 ريالًا قطريًا)
A symbol of your own
arqam("1234.56", {currency: "QAR", brackets: "end", numSymbol: "QR"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا (1,234.56 QR)

Works with

brackets, currency, arabicNumbers

Notes and rules

  • Any other text is used as the symbol itself.
  • A currency without a sign of its own falls back to its code.

Related questions

  • Q63 What label can appear next to the figure in brackets?
  • Q110 Can I give my currency its own symbols?
  • Q351 What does numSymbol do?
  • Q400 What do signs and symbols give?

See also

brackets · currency · arabicNumbers

12.10.11 currDecForce

12.10 Options › currDecForce

the figure shows the currency's places (1,234.00)

Format

arqam(number, {currDecForce: value})
new arqam.NumberFormat("ar", {currDecForce: value}).format(number)
arqam.config({currDecForce: value})
Values"on" | "off"
Default"on"
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

The figure in brackets with all the currency's places (1,234.00) or only those given (1,234).

Purpose and when to use it

  • Cheques: on (the default), the places of the currency.
  • A short note: off.

Values

ValueMeaning
"on" defaultthe figure shows the currency's places (1,234.00)
"off"not applied

Every value on one example

arqam("1234", {currency: "QAR", brackets: "end", currDecForce: "on"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا (1,234.00 QAR)
arqam("1234", {currency: "QAR", brackets: "end", currDecForce: "off"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا (1,234 QAR)

Examples

On (the default)
arqam("1234", {currency: "KWD", brackets: "end"})
→ألف ومائتان وأربعة وثلاثون دينارًا كويتيًا (1,234.000 KWD)
Off
arqam("1234", {currency: "KWD", brackets: "end", currDecForce: "off"})
→ألف ومائتان وأربعة وثلاثون دينارًا كويتيًا (1,234 KWD)

Works with

brackets, currency

Notes and rules

  • The places come from the currency: 2 for SAR, 3 for KWD and BHD, 0 for JPY.

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("1234", {currency: "QAR", brackets: "end", currDecForce: "x"})
→TypeError: arqam.toWords: currDecForce must be "on" or "off" (got "x")

Related questions

  • Q66 Why does the figure show 1,234.00 for a whole amount?
  • Q354 What does currDecForce do?

See also

brackets · currency

12.10.12 arabicNumbers

12.10 Options › arabicNumbers

Arabic-Eastern numbers in the brackets instead of Arabic-Western numbers, with the Arabic separators (unless sepDecimal or sepThousands is given): the Arabic decimal separator (٫ / U+066B): used in formal and typeset Arabic numbers, e.g. ٣٫١; the Arabic thousands separator (٬ / U+066C): groups large numbers into thousands, e.g. ١٬٠٠٠٬٠٠٠

Format

arqam(number, {arabicNumbers: value})
new arqam.NumberFormat("ar", {arabicNumbers: value}).format(number)
arqam.config({arabicNumbers: value})
Values"off" | "on" | "western" | "eastern"
Default"off"
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

Arabic-Eastern numbers (٠١٢٣) in the figure in brackets, with the Arabic separators ٫ and ٬, instead of Arabic-Western numbers (0123).

Purpose and when to use it

  • Egypt, Iraq, Jordan, Saudi Arabia and the other countries that write them: "eastern" (or their locale).
  • The Gulf and the Maghreb: "western".

Values

Value
"off" default
"on"
"western"
"eastern"

Every value on one example

arqam("1234.56", {currency: "QAR", brackets: "end", arabicNumbers: "off"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا (1,234.56 QAR)
arqam("1234.56", {currency: "QAR", brackets: "end", arabicNumbers: "on"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا (١٬٢٣٤٫٥٦ QAR)
arqam("1234.56", {currency: "QAR", brackets: "end", arabicNumbers: "western"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا (1,234.56 QAR)
arqam("1234.56", {currency: "QAR", brackets: "end", arabicNumbers: "eastern"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا (١٬٢٣٤٫٥٦ QAR)

Examples

Arabic-Western (the default)
arqam("1234.56", {currency: "SAR", brackets: "end"})
→ألف ومائتان وأربعة وثلاثون ريالًا سعوديًا، وست وخمسون هللةً (1,234.56 SAR)
Arabic-Eastern
arqam("1234.56", {currency: "SAR", brackets: "end", arabicNumbers: "eastern"})
→ألف ومائتان وأربعة وثلاثون ريالًا سعوديًا، وست وخمسون هللةً (١٬٢٣٤٫٥٦ SAR)
By the region
arqam("1234.56", {locale: "ar-EG", style: "currency", brackets: "end"})
→ألف ومائتان وأربعة وثلاثون جنيهًا مصريًا، وستة وخمسون قرشًا (١٬٢٣٤٫٥٦ EGP)

Works with

brackets, locale, sepThousands, sepDecimal

Notes and rules

  • Arabic-Eastern numbers use the Arabic decimal separator ٫ and thousands separator ٬.
  • The regions that write them (Egypt, Iraq, Jordan, Palestine, Saudi Arabia, Sudan, Syria and Yemen) get them from their locale.

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("1234.56", {currency: "QAR", brackets: "end", arabicNumbers: "x"})
→TypeError: arqam.toWords: arabicNumbers must be "on" or "off", "eastern", "western" (got "x")

Related questions

  • Q65 Can the figure in brackets use Arabic-Eastern digits?
  • Q285 Can a compact date use Arabic-Eastern digits?
  • Q353 What does arabicNumbers do?
  • Q447 Can the reader give Arabic-Eastern digits?
  • Q569 Which digits and separators does each locale use?

See also

brackets · locale · sepThousands · sepDecimal

12.10.13 sepThousands

12.10 Options › sepThousands

the thousands separator in the brackets only

Format

arqam(number, {sepThousands: value})
new arqam.NumberFormat("ar", {sepThousands: value}).format(number)
arqam.config({sepThousands: value})
Values"" | a character or a locale
Default""
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

The thousands separator in the figure in brackets only; the words never change.
A character, or a locale name that gives both separators.

Purpose and when to use it

  • The reader's country: «.» in the Maghreb and much of Europe, «'» in Switzerland.
  • A locale name ("fr") for both at once.

Values

ValueMeaning
"" defaultthe thousands separator in the brackets only
a character or a locale

Examples

A dot
arqam("1234567.5", {currency: "EUR", brackets: "end", sepThousands: ".", sepDecimal: ","})
→مليون ومائتان وأربعة وثلاثون ألفًا وخمسمائة وسبعة وستون يورو، وخمسون سنتًا (1.234.567,50 EUR)
An apostrophe
arqam("1234567.5", {currency: "CHF", brackets: "end", sepThousands: "'"})
→مليون ومائتان وأربعة وثلاثون ألفًا وخمسمائة وسبعة وستون فرنكًا سويسريًا، وخمسون رابنًا (1'234'567.50 CHF)
A space
arqam("1234567.5", {currency: "SAR", brackets: "end", sepThousands: " "})
→مليون ومائتان وأربعة وثلاثون ألفًا وخمسمائة وسبعة وستون ريالًا سعوديًا، وخمسون هللةً (1 234 567.50 SAR)
A locale for both
arqam("1234567.5", {currency: "EUR", brackets: "end", sepThousands: "fr"})
→مليون ومائتان وأربعة وثلاثون ألفًا وخمسمائة وسبعة وستون يورو، وخمسون سنتًا (1 234 567.50 EUR)

Works with

sepDecimal, brackets, arabicNumbers

Notes and rules

  • The words never change; only the figure in brackets does.
  • A locale name gives both separators as Intl writes them for that locale.

Related questions

  • Q47 Does the browser's language or region change the words?
  • Q64 Can the figure in brackets use other separators?
  • Q352 What do sepThousands and sepDecimal do?
  • Q532 Which separators do Arabic-Eastern numbers use?
  • Q569 Which digits and separators does each locale use?

See also

sepDecimal · brackets · arabicNumbers

12.10.14 sepDecimal

12.10 Options › sepDecimal

the decimal separator in the brackets only; give sepThousands with it

Format

arqam(number, {sepDecimal: value})
new arqam.NumberFormat("ar", {sepDecimal: value}).format(number)
arqam.config({sepDecimal: value})
Values"" | a character or a locale
Default""
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

The decimal separator in the figure in brackets only; the words never change.
With a character, give sepThousands too, or the two may be the same.

Purpose and when to use it

  • «,» in the Maghreb and much of Europe; «٫» with Arabic-Eastern numbers.
  • A locale name ("fr") gives both separators.

Values

ValueMeaning
"" defaultthe decimal separator in the brackets only; give sepThousands with it
a character or a locale

Examples

A comma
arqam("1234.5", {currency: "EUR", brackets: "end", sepThousands: ".", sepDecimal: ","})
→ألف ومائتان وأربعة وثلاثون يورو، وخمسون سنتًا (1.234,50 EUR)
The Arabic separator
arqam("1234.5", {currency: "SAR", brackets: "end", sepDecimal: "٫", sepThousands: "٬"})
→ألف ومائتان وأربعة وثلاثون ريالًا سعوديًا، وخمسون هللةً (1٬234٫50 SAR)
A locale for both
arqam("1234.5", {currency: "EUR", brackets: "end", sepDecimal: "de"})
→ألف ومائتان وأربعة وثلاثون يورو، وخمسون سنتًا (1,234,50 EUR)

Works with

sepThousands, brackets, locale

Notes and rules

  • Give sepThousands with a character, or the two separators may be the same and the figure ambiguous.

Related questions

  • Q64 Can the figure in brackets use other separators?
  • Q352 What do sepThousands and sepDecimal do?
  • Q532 Which separators do Arabic-Eastern numbers use?
  • Q569 Which digits and separators does each locale use?

See also

sepThousands · brackets · locale

12.10.15 prefix

12.10 Options › prefix

words before the words; «فقط» makes the cheque form

Format

arqam(number, {prefix: value})
new arqam.NumberFormat("ar", {prefix: value}).format(number)
arqam.config({prefix: value})
Values"" | text
Default""
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

Words before the words, such as «فقط»; with «فقط» it is the cheque form, which brings «واحد/اثنان» after the noun.

Purpose and when to use it

  • Cheques: «فقط».
  • A sentence: «دفعتُ», with ierab nasb.

Values

ValueMeaning
"" defaultwords before the words; «فقط» makes the cheque form
text

Examples

A cheque
arqam("1234.56", {currency: "AED", prefix: "فقط"})
→فقط ألف ومائتان وأربعة وثلاثون درهمًا إماراتيًا، وستة وخمسون فلسًا
A sentence
arqam("2000", {currency: "QAR", ierab: "nasb", prefix: "دفعتُ"})
→دفعتُ ألفي ريال قطري
With a suffix
arqam("2", {currency: "AED", prefix: "فقط", suffix: "لا غير"})
→فقط درهمان إماراتيان اثنان لا غير

Works with

suffix, ierab, emphasisOneTwo

Notes and rules

  • «فقط» in the prefix makes the cheque form, which brings «واحد/اثنان» after the noun.
  • The prefix does not change the case: give ierab for the sentence.

Related questions

  • Q60 What is toParts() and when do I need it?
  • Q161 Do prefix and suffix get tashkeel?
  • Q247 How do I write «فقط … لا غير»?
  • Q344 What do prefix and suffix do?
  • Q484 How do I print a cheque or an invoice with the words?
  • Q534 Which types of part are there?

See also

suffix · ierab · emphasisOneTwo

12.10.16 suffix

12.10 Options › suffix

words after the words; «لا غير» makes the cheque form

Format

arqam(number, {suffix: value})
new arqam.NumberFormat("ar", {suffix: value}).format(number)
arqam.config({suffix: value})
Values"" | text
Default""
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

Words after the words, such as «لا غير»; with «لا غير» it is the cheque form.

Purpose and when to use it

  • Cheques: «لا غير».
  • A receipt: «فقط» before and «لا غير» after.

Values

ValueMeaning
"" defaultwords after the words; «لا غير» makes the cheque form
text

Examples

A cheque
arqam("1234.56", {currency: "AED", suffix: "لا غير"})
→ألف ومائتان وأربعة وثلاثون درهمًا إماراتيًا، وستة وخمسون فلسًا لا غير
Both
arqam("1234.56", {currency: "AED", prefix: "فقط", suffix: "لا غير"})
→فقط ألف ومائتان وأربعة وثلاثون درهمًا إماراتيًا، وستة وخمسون فلسًا لا غير
Any text
arqam("500", {currency: "QAR", suffix: "فقط لا غير"})
→خمسمائة ريال قطري فقط لا غير

Works with

prefix, emphasisOneTwo

Notes and rules

  • «لا غير» in the suffix makes the cheque form.

Related questions

  • Q60 What is toParts() and when do I need it?
  • Q161 Do prefix and suffix get tashkeel?
  • Q247 How do I write «فقط … لا غير»?
  • Q344 What do prefix and suffix do?
  • Q484 How do I print a cheque or an invoice with the words?
  • Q534 Which types of part are there?

See also

prefix · emphasisOneTwo

12.10.17 compact

12.10 Options › compact

groups as figures, scale words in letters

Format

arqam(number, {compact: value})
new arqam.NumberFormat("ar", {compact: value}).format(number)
arqam.config({compact: value})
Values"off" | "on"
Default"off"
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

The groups as figures and the scale words in letters: «مليون و234 ألفًا».

Purpose and when to use it

  • Large amounts in a news text or a report.
  • A table where the words must be short.

Values

ValueMeaning
"off" defaultnot applied
"on"groups as figures, scale words in letters

Every value on one example

arqam("1234567.56", {currency: "USD", compact: "off"})
→مليون ومائتان وأربعة وثلاثون ألفًا وخمسمائة وسبعة وستون دولارًا أمريكيًا، وستة وخمسون سنتًا
arqam("1234567.56", {currency: "USD", compact: "on"})
→مليون و234 ألفًا و567 دولارًا أمريكيًا، و56 سنتًا

Examples

A large amount
arqam("1234567", {currency: "QAR", compact: "on"})
→مليون و234 ألفًا و567 ريالًا قطريًا
Millions
arqam("45000000", {compact: "on"})
→45 مليونًا

Works with

scale

Notes and rules

  • The groups are written as figures and the scale words in letters, as in news text.

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("1234567.56", {currency: "USD", compact: "x"})
→TypeError: arqam.toWords: compact must be "on" or "off" (got "x")

Related questions

  • Q201 Can I write the groups as figures and only the scale words in letters?
  • Q207 Can compact be used with tashkeel?
  • Q285 Can a compact date use Arabic-Eastern digits?
  • Q294 Does the compact style use the era «م» and «هـ»?
  • Q356 What does compact do?

See also

scale

12.10.18 comma

12.10 Options › comma

the Arabic comma before و between groups; off by default

Format

arqam(number, {comma: value})
new arqam.NumberFormat("ar", {comma: value}).format(number)
arqam.config({comma: value})
Values"off" | "on"
Default"off"
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

The Arabic comma before «و» between the groups: «ألف، ومائتان».

Purpose and when to use it

  • Long numbers that read more easily with a pause.
  • Off (the default) for a short amount.

Values

ValueMeaning
"off" defaultnot applied
"on"the Arabic comma before و between groups; off by default

Every value on one example

arqam("1234.56", {currency: "QAR", comma: "off"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا
arqam("1234.56", {currency: "QAR", comma: "on"})
→ألف، ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا

Examples

Off (the default)
arqam("1234567")
→مليون ومائتان وأربعة وثلاثون ألفًا وخمسمائة وسبعة وستون
On
arqam("1234567", {comma: "on"})
→مليون، ومائتان وأربعة وثلاثون ألفًا، وخمسمائة وسبعة وستون

Works with

wordOrder

Notes and rules

  • The comma is the Arabic comma «،», before the «و» that joins two groups.

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("1234.56", {currency: "QAR", comma: "x"})
→TypeError: arqam.toWords: comma must be "on" or "off" (got "x")

Related questions

  • Q53 Can I pass a decimal comma, "12,5"?
  • Q59 How do I get an Arabic comma before و between the groups?
  • Q172 How is 1,000,001 written?
  • Q357 What does comma do?

See also

wordOrder

12.10.19 miah

12.10 Options › miah

مائة or مئة

Format

arqam(number, {miah: value})
new arqam.NumberFormat("ar", {miah: value}).format(number)
arqam.config({miah: value})
Values"on" | "off"
Default"on"
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

The spelling مائة (with the alif, the default) or مئة.

Purpose and when to use it

  • Banks and official forms: مائة.
  • Modern print: مئة.

Values

ValueMeaning
"on" defaultمائة or مئة
"off"not applied

Every value on one example

arqam("300", {miah: "on"})
→ثلاثمائة
arqam("300", {miah: "off"})
→ثلاثمئة

Examples

مائة (the default)
arqam("300")
→ثلاثمائة
مئة
arqam("300", {miah: "off"})
→ثلاثمئة
In a larger number
arqam("1500", {currency: "QAR", miah: "off"})
→ألف وخمسمئة ريال قطري

Works with

miahSplit

Notes and rules

  • Both spellings are correct; مائة is the older and the one banks use.

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("300", {miah: "x"})
→TypeError: arqam.toWords: miah must be "on" or "off" (got "x")

Related questions

  • Q199 Can I write مئة instead of مائة?
  • Q358 What do miah and miahSplit do?

See also

miahSplit

12.10.20 miahSplit

12.10 Options › miahSplit

ثلاث مائة written apart

Format

arqam(number, {miahSplit: value})
new arqam.NumberFormat("ar", {miahSplit: value}).format(number)
arqam.config({miahSplit: value})
Values"off" | "on"
Default"off"
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

The hundreds written apart: ثلاث مائة instead of ثلاثمائة.

Purpose and when to use it

  • A house style that separates them.
  • Teaching how the hundreds are made.

Values

ValueMeaning
"off" defaultnot applied
"on"ثلاث مائة written apart

Every value on one example

arqam("300", {miahSplit: "off"})
→ثلاثمائة
arqam("300", {miahSplit: "on"})
→ثلاث مائة

Examples

Joined (the default)
arqam("300")
→ثلاثمائة
Apart
arqam("300", {miahSplit: "on"})
→ثلاث مائة
With مئة
arqam("800", {miahSplit: "on", miah: "off"})
→ثمان مئة

Works with

miah

Notes and rules

  • Only the hundreds 300–900 are affected.

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("300", {miahSplit: "x"})
→TypeError: arqam.toWords: miahSplit must be "on" or "off" (got "x")

Related questions

  • Q199 Can I write مئة instead of مائة?
  • Q358 What do miah and miahSplit do?

See also

miah

12.10.21 tanweenAlif

12.10 Options › tanweenAlif

tanween on the letter before the alif (ريالاً)

Format

arqam(number, {tanweenAlif: value})
new arqam.NumberFormat("ar", {tanweenAlif: value}).format(number)
arqam.config({tanweenAlif: value})
Values"off" | "on"
Default"off"
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

The tanween on the letter before the alif (ريالاً) instead of on the alif (ريالًا).

Purpose and when to use it

  • An older or a house style.
  • Fonts that place the tanween better that way.

Values

ValueMeaning
"off" defaultnot applied
"on"tanween on the letter before the alif (ريالاً)

Every value on one example

arqam("21", {currency: "QAR", tashkeel: "alif", tanweenAlif: "off"})
→واحد وعشرون ريالًا قطريًا
arqam("21", {currency: "QAR", tashkeel: "alif", tanweenAlif: "on"})
→واحد وعشرون ريالاً قطرياً

Examples

On the alif (the default)
arqam("21", {currency: "QAR", tashkeel: "alif"})
→واحد وعشرون ريالًا قطريًا
Before the alif
arqam("21", {currency: "QAR", tashkeel: "alif", tanweenAlif: "on"})
→واحد وعشرون ريالاً قطرياً

Works with

tashkeel

Notes and rules

  • It applies only when the words carry the tanween (tashkeel other than none).

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("21", {currency: "QAR", tashkeel: "alif", tanweenAlif: "x"})
→TypeError: arqam.toWords: tanweenAlif must be "on" or "off" (got "x")

Related questions

  • Q154 Where does the tanween go: on the alif or before it?
  • Q359 What does tanweenAlif do?

See also

tashkeel

12.10.22 addZero

12.10 Options › addZero

صفر before a fraction of one

Format

arqam(number, {addZero: value})
new arqam.NumberFormat("ar", {addZero: value}).format(number)
arqam.config({addZero: value})
Values"off" | "on"
Default"off"
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

«صفر» before a fraction of one: «صفر، وخمسة أجزاء من العشرة».

Purpose and when to use it

  • Scientific or school texts.
  • Off (the default) for amounts.

Values

ValueMeaning
"off" defaultnot applied
"on"صفر before a fraction of one

Every value on one example

arqam("0.5", {addZero: "off"})
→خمسة أجزاء من العشرة
arqam("0.5", {addZero: "on"})
→صفر، وخمسة أجزاء من العشرة

Examples

Off (the default)
arqam("0.5")
→خمسة أجزاء من العشرة
On
arqam("0.5", {addZero: "on"})
→صفر، وخمسة أجزاء من العشرة

Works with

decFormat

Notes and rules

  • For amounts the minor unit is used instead: 0.50 QAR is «خمسون درهما».

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("0.5", {addZero: "x"})
→TypeError: arqam.toWords: addZero must be "on" or "off" (got "x")

Related questions

  • Q211 How do I say «صفر» before a fraction of one?
  • Q360 What does addZero do?

See also

decFormat

12.10.23 decFormat

12.10 Options › decFormat

the fraction's form (12.13)

Format

arqam(number, {decFormat: value})
new arqam.NumberFormat("ar", {decFormat: value}).format(number)
arqam.config({decFormat: value})
Values"auto" | "words" | "figures" | "digits" | "words-words" | "words-figures" | "figures-words" | "figures-figures" | "decimal" | "slash"
Default"auto"
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

The form of the fraction: in words, in figures, the two mixed, as a decimal or as a slash (12.13).

Purpose and when to use it

  • Cheques: the default, the minor unit in words.
  • Accounts: "figures" or "slash".

Values

ValueOther names
"auto" default""
"words""w"
"figures""n"
"digits""sw"
"words-words""ww"
"words-figures""wn"
"figures-words""nw"
"figures-figures""nn"
"decimal""d"
"slash"" "

Every value on one example

arqam("12.75", {decFormat: "auto"})
→اثنا عشر، وخمسة وسبعون جزءًا من المائة
arqam("12.75", {decFormat: "words"})
→اثنا عشر، فاصلة خمسة وسبعون
arqam("12.75", {decFormat: "figures"})
→اثنا عشر، فاصلة 75
arqam("12.75", {decFormat: "digits"})
→اثنا عشر، فاصلة سبعة، خمسة
arqam("12.75", {decFormat: "words-words"})
→اثنا عشر، وخمسة وسبعون جزءًا من المائة
arqam("12.75", {decFormat: "words-figures"})
→اثنا عشر، وخمسة وسبعون جزءًا من الـ100
arqam("12.75", {decFormat: "figures-words"})
→اثنا عشر، و75 جزءًا من المائة
arqam("12.75", {decFormat: "figures-figures"})
→اثنا عشر، و75 من الـ100
arqam("12.75", {decFormat: "decimal"})
→اثنا عشر، و0.75
arqam("12.75", {decFormat: "slash"})
→اثنا عشر، و75/100

Examples

Auto (the default)
arqam("12.13", {currency: "QAR"})
→اثنا عشر ريالًا قطريًا، وثلاثة عشر درهمًا
Words
arqam("12.13", {decFormat: "words"})
→اثنا عشر، فاصلة ثلاثة عشر
Figures
arqam("12.13", {currency: "QAR", decFormat: "figures"})
→اثنا عشر ريالًا قطريًا، و13 درهمًا
Digits
arqam("12.13", {decFormat: "digits"})
→اثنا عشر، فاصلة واحد، ثلاثة
Slash
arqam("12.13", {currency: "QAR", decFormat: "slash"})
→اثنا عشر ريالًا قطريًا، و13/100 ريال

Works with

decJuz, decAL, decFaslah

Notes and rules

  • Each form is shown with its own example in 12.13 (fractions).

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("12.75", {decFormat: "x"})
→TypeError: arqam.toWords: decFormat must be one of "auto" or "", "words" or "w", "figures" or "n", "digits" or "sw", "words-words" or "ww", "words-figures" or "wn", "figures-words" or "nw", "figures-figures" or "nn", "decimal" or "d", "slash" or "/" (got "x")

Related questions

  • Q210 Which forms of the decimal part are there?
  • Q346 What does decFormat do?

See also

decJuz · decAL · decFaslah

12.10.24 decJuz

12.10 Options › decJuz

the word جزء in fractions

Format

arqam(number, {decJuz: value})
new arqam.NumberFormat("ar", {decJuz: value}).format(number)
arqam.config({decJuz: value})
Values"on" | "off"
Default"on"
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

The word جزء in a fraction: «خمسة وسبعون جزءًا من المائة» or without it.

Purpose and when to use it

  • Formal texts: with it (the default).
  • Short notes: without.

Values

ValueMeaning
"on" defaultthe word جزء in fractions
"off"not applied

Every value on one example

arqam("12.75", {decJuz: "on"})
→اثنا عشر، وخمسة وسبعون جزءًا من المائة
arqam("12.75", {decJuz: "off"})
→اثنا عشر، وخمسة وسبعون من المائة

Examples

With جزء (the default)
arqam("12.75")
→اثنا عشر، وخمسة وسبعون جزءًا من المائة
Without
arqam("12.75", {decJuz: "off"})
→اثنا عشر، وخمسة وسبعون من المائة

Works with

decFormat, decAL

Notes and rules

  • Only plain numbers are affected; an amount uses its minor unit.

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("12.75", {decJuz: "x"})
→TypeError: arqam.toWords: decJuz must be "on" or "off" (got "x")

Related questions

  • Q214 How do I leave out the word جزء, or the الـ in من المائة?
  • Q361 What does decJuz do?

See also

decFormat · decAL

12.10.25 decAL

12.10 Options › decAL

من المائة or من مائة

Format

arqam(number, {decAL: value})
new arqam.NumberFormat("ar", {decAL: value}).format(number)
arqam.config({decAL: value})
Values"on" | "off"
Default"on"
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

The fraction's denominator with الـ (من المائة, the default) or without (من مائة).

Purpose and when to use it

  • Usual Arabic: with الـ.
  • Some house styles: without.

Values

ValueMeaning
"on" defaultمن المائة or من مائة
"off"not applied

Every value on one example

arqam("12.75", {decAL: "on"})
→اثنا عشر، وخمسة وسبعون جزءًا من المائة
arqam("12.75", {decAL: "off"})
→اثنا عشر، وخمسة وسبعون جزءًا من مائة

Examples

With الـ (the default)
arqam("12.75")
→اثنا عشر، وخمسة وسبعون جزءًا من المائة
Without
arqam("12.75", {decAL: "off"})
→اثنا عشر، وخمسة وسبعون جزءًا من مائة

Works with

decJuz

Notes and rules

  • Only plain numbers are affected.

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("12.75", {decAL: "x"})
→TypeError: arqam.toWords: decAL must be "on" or "off" (got "x")

Related questions

  • Q214 How do I leave out the word جزء, or the الـ in من المائة?
  • Q362 What does decAL do?

See also

decJuz

12.10.26 decFaslah

12.10 Options › decFaslah

فاصلة instead of و before the fraction

Format

arqam(number, {decFaslah: value})
new arqam.NumberFormat("ar", {decFaslah: value}).format(number)
arqam.config({decFaslah: value})
Values"off" | "on"
Default"off"
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

«فاصلة» instead of «و» before the fraction: «اثنا عشر فاصلة خمسة وسبعون».

Purpose and when to use it

  • Measurements and statistics read aloud.
  • Off (the default) for amounts.

Values

ValueMeaning
"off" defaultnot applied
"on"فاصلة instead of و before the fraction

Every value on one example

arqam("12.75", {decFaslah: "off"})
→اثنا عشر، وخمسة وسبعون جزءًا من المائة
arqam("12.75", {decFaslah: "on"})
→اثنا عشر، فاصلة خمسة وسبعون جزءًا من المائة

Examples

Off (the default)
arqam("12.75")
→اثنا عشر، وخمسة وسبعون جزءًا من المائة
On
arqam("12.75", {decFaslah: "on"})
→اثنا عشر، فاصلة خمسة وسبعون جزءًا من المائة

Works with

decFormat

Notes and rules

  • Read aloud, «فاصلة» is how a measurement is usually said.

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("12.75", {decFaslah: "x"})
→TypeError: arqam.toWords: decFaslah must be "on" or "off" (got "x")

Related questions

  • Q212 How do I use «فاصلة» instead of «و»?
  • Q363 What does decFaslah do?

See also

decFormat

12.10.27 decIgnore

12.10 Options › decIgnore

the whole part only

Format

arqam(number, {decIgnore: value})
new arqam.NumberFormat("ar", {decIgnore: value}).format(number)
arqam.config({decIgnore: value})
Values"off" | "on"
Default"off"
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

The whole part only: the fraction is left out.

Purpose and when to use it

  • A cheque line written in whole riyals.
  • Counts that cannot have a fraction.

Values

ValueMeaning
"off" defaultnot applied
"on"the whole part only

Every value on one example

arqam("1234.56", {currency: "QAR", decIgnore: "off"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا
arqam("1234.56", {currency: "QAR", decIgnore: "on"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا

Examples

Off (the default)
arqam("1234.56", {currency: "QAR"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا
On
arqam("1234.56", {currency: "QAR", decIgnore: "on"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا

Works with

currency

Notes and rules

  • The fraction is left out, not rounded.

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("1234.56", {currency: "QAR", decIgnore: "x"})
→TypeError: arqam.toWords: decIgnore must be "on" or "off" (got "x")

Related questions

  • Q213 Can I write only the whole part?
  • Q364 What does decIgnore do?

See also

currency

12.10.28 decRound

12.10 Options › decRound

decimal places kept, cut; with it there is no rounding as Intl ("": maximumFractionDigits decides)

Format

arqam(number, {decRound: value})
new arqam.NumberFormat("ar", {decRound: value}).format(number)
arqam.config({decRound: value})
Values"" | a number
Default""
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

The decimal places kept, cut at that number; with it, toWords does not round as Intl.
"" (the default) leaves the places to maximumFractionDigits.

Purpose and when to use it

  • Two places of a measurement, cut.
  • To round instead: maximumFractionDigits.

Values

ValueMeaning
"" defaultdecimal places kept, cut; with it there is no rounding as Intl ("": maximumFractionDigits decides)
a number

Examples

Two places, cut
arqam("3.14159", {decRound: 2})
→ثلاثة، وأربعة عشر جزءًا من المائة
No places
arqam("3.99", {decRound: 0})
→ثلاثة، وتسعة وتسعون جزءًا من المائة
To round instead
arqam("3.14159", {maximumFractionDigits: 2})
→ثلاثة، وأربعة عشر جزءًا من المائة

Works with

rounding, maximumFractionDigits

Notes and rules

  • With decRound, toWords does not round as Intl does; the places are cut.

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("3.14159", {decRound: "x"})
→TypeError: arqam.toWords: decRound must be a whole number of 0 or more (got "x")

Related questions

  • Q44 What is the largest number of decimal places?
  • Q216 How do I limit or round the decimals of a plain number?
  • Q365 What does decRound do?

See also

rounding

12.10.29 rounding

12.10 Options › rounding

an amount's extra places: rounded half up (as toWords does by default) or cut

Format

arqam(number, {rounding: value})
new arqam.NumberFormat("ar", {rounding: value}).format(number)
arqam.config({rounding: value})
Values"" | "on" | "off"
Default""
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

The extra places of an amount rounded half up ("on", as toWords does by default) or cut ("off", as roundingMode "trunc").

Purpose and when to use it

  • A price from a longer figure: "on".
  • A bank that cuts: "off".

Values

Value
"" default
"on"
"off"

Every value on one example

arqam("2.675", {currency: "QAR", rounding: ""})
→ريالان قطريان، وسبعة وستون درهمًا
arqam("2.675", {currency: "QAR", rounding: "on"})
→ريالان قطريان، وثمانية وستون درهمًا
arqam("2.675", {currency: "QAR", rounding: "off"})
→ريالان قطريان، وسبعة وستون درهمًا

Examples

Rounded (the default)
arqam("2.675", {currency: "QAR"})
→ريالان قطريان، وثمانية وستون درهمًا
Cut
arqam("2.675", {currency: "QAR", rounding: "off"})
→ريالان قطريان، وسبعة وستون درهمًا
Carried into the whole number
arqam("9.999", {currency: "QAR"})
→عشرة ريالات قطرية

Works with

currency, decRound

Notes and rules

  • Rounding is half up and carries into the whole number (9.999 → 10.00).
  • roundingMode "trunc" is Intl's name for cutting.

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("2.675", {currency: "QAR", rounding: "x"})
→TypeError: arqam.toWords: rounding must be "on" or "off" (got "x")

Related questions

  • Q44 What is the largest number of decimal places?
  • Q101 Why does 2.675 riyals say sixty-eight dirhams, not sixty-seven?
  • Q102 What about currencies with no minor unit, such as the yen?
  • Q216 How do I limit or round the decimals of a plain number?
  • Q347 What does rounding do?

See also

currency · decRound

12.10.30 ignoreCountry

12.10 Options › ignoreCountry

ريال instead of ريال قطري

Format

arqam(number, {ignoreCountry: value})
new arqam.NumberFormat("ar", {ignoreCountry: value}).format(number)
arqam.config({ignoreCountry: value})
Values"off" | "on"
Default"off"
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

The currency without its country: ريال instead of ريال قطري.

Purpose and when to use it

  • Inside the country, where the currency is known.
  • A unit of measure, which has no country.

Values

ValueMeaning
"off" defaultnot applied
"on"ريال instead of ريال قطري

Every value on one example

arqam("1234.56", {currency: "QAR", ignoreCountry: "off"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا
arqam("1234.56", {currency: "QAR", ignoreCountry: "on"})
→ألف ومائتان وأربعة وثلاثون ريالًا، وستة وخمسون درهمًا

Examples

Off (the default)
arqam("1234.56", {currency: "QAR"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا
On
arqam("1234.56", {currency: "QAR", ignoreCountry: "on"})
→ألف ومائتان وأربعة وثلاثون ريالًا، وستة وخمسون درهمًا

Works with

currency

Notes and rules

  • The minor unit has no country either way.

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("1234.56", {currency: "QAR", ignoreCountry: "x"})
→TypeError: arqam.toWords: ignoreCountry must be "on" or "off" (got "x")

Related questions

  • Q100 How do I leave out the country (ريال instead of ريال قطري)?
  • Q366 What does ignoreCountry do?

See also

currency

12.10.31 percent

12.10 Options › percent

a percentage (also "25%")

Format

arqam(number, {percent: value})
new arqam.NumberFormat("ar", {percent: value}).format(number)
arqam.config({percent: value})
Values"off" | "on"
Default"off"
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

A percentage: the number with «بالمائة» (a text with % is read as one too).

Purpose and when to use it

  • Rates and shares.
  • Or give "25%" as the number.

Values

ValueMeaning
"off" defaultnot applied
"on"a percentage (also "25%")

Every value on one example

arqam("12.5", {percent: "off"})
→اثنا عشر، وخمسة أجزاء من العشرة
arqam("12.5", {percent: "on"})
→اثنا عشر فاصلة خمسة بالمائة

Examples

As an option
arqam("12.5", {percent: "on"})
→اثنا عشر فاصلة خمسة بالمائة
As text
arqam("25%")
→خمسة وعشرون بالمائة

Works with

decFormat

Notes and rules

  • A text that ends in % is read as a percentage without the option.

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("12.5", {percent: "x"})
→TypeError: arqam.toWords: percent must be "on" or "off" (got "x")

Related questions

  • Q60 What is toParts() and when do I need it?
  • Q233 How do I write a percentage?
  • Q348 What does percent do?
  • Q512 Which styles are there?
  • Q515 What does style "percent" do with 0.125?

See also

decFormat

12.10.32 ordinal

12.10 Options › ordinal

the ordinal, masculine or feminine, 1–999,999

Format

arqam(number, {ordinal: value})
new arqam.NumberFormat("ar", {ordinal: value}).format(number)
arqam.config({ordinal: value})
Values"" | "masculine" | "feminine"
Default""
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

The ordinal, masculine or feminine, up to 999,999: الحادي عشر، الحادية والعشرون.

Purpose and when to use it

  • Articles and chapters: «المادة الحادية عشرة».
  • Anniversaries and rankings.

Values

ValueOther names
"" default—
"masculine""m"
"feminine""f"

Every value on one example

arqam("11", {ordinal: ""})
→أحد عشر
arqam("11", {ordinal: "masculine"})
→الحادي عشر
arqam("11", {ordinal: "feminine"})
→الحادية عشرة

Examples

Masculine
arqam("21", {ordinal: "masculine"})
→الحادي والعشرون
Feminine
arqam("21", {ordinal: "feminine"})
→الحادية والعشرون
Without الـ
arqam("3", {ordinal: "feminine", ordinalDefinite: "off"})
→ثالثة
A large ordinal
arqam("1001", {ordinal: "masculine"})
→الحادي بعد الألف

Works with

ierab, tashkeel

Notes and rules

  • Ordinals go up to 999,999.
  • ordinalDefinite "off" writes them without الـ.

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("11", {ordinal: "x"})
→TypeError: arqam.toWords: ordinal must be one of "masculine" or "m", "feminine" or "f", "" (got "x")

Related questions

  • Q60 What is toParts() and when do I need it?
  • Q74 What is in the figure of toParts() for a percentage or an ordinal?
  • Q234 How do I write ordinals (first, second …)?
  • Q235 Does an ordinal change in the accusative and the genitive?
  • Q236 Why is the ordinal of 200,000 «مائتا الألف» and not «المائتا ألف»?
  • Q237 Can I write an ordinal without الـ?

See also

ierab · tashkeel

12.10.33 wordOrder

12.10 Options › wordOrder

the largest part first (default) or the smallest, as in classical Arabic (12.14)

Format

arqam(number, {wordOrder: value})
new arqam.NumberFormat("ar", {wordOrder: value}).format(number)
arqam.config({wordOrder: value})
Values"" | "large" | "small"
Default""
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

The largest part first (the default) or the smallest first, as in classical Arabic (12.14).

Purpose and when to use it

  • Classical and religious texts: "small".
  • Everyday use: the default.

Background: classical and modern number order

  • Where it came from: The "small" (ascending) word order traces back to Proto-Semitic counting patterns and Classical Arabic (al-ʻArabīyah al-Fuṣḥā) in the Arabian Peninsula and early Islamic scholarly centres (such as Basra and Kufa in present-day Iraq).
  • How it worked: The units came first, then the tens, hundreds and thousands, joined by the conjunction wa- ("and"). Classical historians, poets and legal scholars wrote dates and large figures this way, for example 1925 as "five and twenty and nine hundred and one thousand" («خمسة وعشرون وتسعمائة وألف»).
  • When and why it changed: From the 19th and 20th centuries, driven by printing presses, banking, international trade and broadcast media, Modern Standard Arabic (MSA) largely standardised on descending order ("large") for hundreds, thousands and millions, while keeping ascending order ("small") within 11–99.
  • When to use "small": Classical literature, historical dates (such as Hijri years in traditional prose), religious texts, and formal rhetorical speeches where traditional grammar is expected.

Source for the 21–99 order and its Proto-Semitic roots: Arabify, Arabic numbers guide

Values

Value
"" default
"large"
"small"

Every value on one example

arqam("1250", {currency: "QAR", wordOrder: ""})
→ألف ومائتان وخمسون ريالًا قطريًا
arqam("1250", {currency: "QAR", wordOrder: "large"})
→ألف ومائتان وخمسون ريالًا قطريًا
arqam("1250", {currency: "QAR", wordOrder: "small"})
→خمسون ومائتان وألف ريال قطري

Examples

Largest first (the default)
arqam("1234")
→ألف ومائتان وأربعة وثلاثون
Smallest first
arqam("1234", {wordOrder: "small"})
→أربعة وثلاثون ومائتان وألف
An amount
arqam("125", {currency: "QAR", wordOrder: "small"})
→خمسة وعشرون ومائة ريال قطري

Works with

comma

Notes and rules

  • The classical order reads from the units up: «أربعة وثلاثون ومائتان وألف».

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("1250", {currency: "QAR", wordOrder: "x"})
→TypeError: arqam.toWords: wordOrder must be one of "", "large", "small" (got "x")

Related questions

  • Q168 What is the classical word order?
  • Q280 Can the year be written in the classical order?
  • Q370 What does wordOrder do?

See also

comma

12.10.34 approx

12.10 Options › approx

an approximate quantity: قرابة، ما يزيد على، أقلّ من، ما لا يقل عن، ما لا يزيد على، بضعة، نيّف (12.24)

Format

arqam(number, {approx: value})
new arqam.NumberFormat("ar", {approx: value}).format(number)
arqam.config({approx: value})
Values"" | "about" | "over" | "under" | "atLeast" | "atMost" | "few" | "plus"
Default""
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

An approximate quantity: قرابة، ما يزيد على، أقلّ من، ما لا يقل عن، ما لا يزيد على، بضعة، نيّف (12.24).

Purpose and when to use it

  • News and reports: «قرابة ألف ريال».
  • Estimates in contracts: «ما لا يزيد على».

Values

Value
"" default
"about"
"over"
"under"
"atLeast"
"atMost"
"few"
"plus"

Every value on one example

arqam("5000", {currency: "EGP", approx: ""})
→خمسة آلاف جنيه مصري
arqam("5000", {currency: "EGP", approx: "about"})
→قرابة خمسة آلاف جنيه مصري
arqam("5000", {currency: "EGP", approx: "over"})
→ما يزيد على خمسة آلاف جنيه مصري
arqam("5000", {currency: "EGP", approx: "under"})
→أقل من خمسة آلاف جنيه مصري
arqam("5000", {currency: "EGP", approx: "atLeast"})
→ما لا يقل عن خمسة آلاف جنيه مصري
arqam("5000", {currency: "EGP", approx: "atMost"})
→ما لا يزيد على خمسة آلاف جنيه مصري
arqam("5000", {currency: "EGP", approx: "few"})
→بضعة آلاف جنيه مصري
arqam("5000", {currency: "EGP", approx: "plus"})
→""

Examples

About
arqam("1000", {currency: "QAR", approx: "about"})
→قرابة ألف ريال قطري
Over
arqam("1000", {currency: "QAR", approx: "over"})
→ما يزيد على ألف ريال قطري
Under
arqam("1000", {currency: "QAR", approx: "under"})
→أقل من ألف ريال قطري
At least
arqam("1000", {currency: "QAR", approx: "atLeast"})
→ما لا يقل عن ألف ريال قطري
A few
arqam("3000", {approx: "few"})
→بضعة آلاف

Works with

approxWord, approxRound, ierab

Notes and rules

  • The number is written in the case the approximate word asks (قرابةَ ألفِ ريال).
  • "few" and "plus" need a round number (بضعة آلاف، نيّف وعشرون).

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("5000", {currency: "EGP", approx: "x"})
→TypeError: arqam.toWords: approx must be one of "", "none", "about", "over", "under", "atleast", "atmost", "few", "plus" (got "x")

Related questions

  • Q551 How do I write «قرابة ألف ريال»?
  • Q555 Why is the result empty for 150 with «بضعة»?
  • Q558 How do I style «قرابة» on its own?
  • Q560 Can words back to numbers read them?

See also

approxWord · approxRound · ierab

12.10.35 approxWord

12.10 Options › approxWord

the word of approx "about": قرابة (default), نحو، زهاء، حوالَيْ

Format

arqam(number, {approxWord: value})
new arqam.NumberFormat("ar", {approxWord: value}).format(number)
arqam.config({approxWord: value})
Values"qurabah" | "nahw" | "zuhaa" | "hawali"
Default"qurabah"
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

The word of approx "about": قرابة (the default), نحو، زهاء، حوالَيْ.

Purpose and when to use it

  • A house style that writes نحو.
  • Variety in a long text.

Values

Value
"qurabah" default
"nahw"
"zuhaa"
"hawali"

Every value on one example

arqam("20", {approx: "about", approxWord: "qurabah"})
→قرابة عشرين
arqam("20", {approx: "about", approxWord: "nahw"})
→نحو عشرين
arqam("20", {approx: "about", approxWord: "zuhaa"})
→زهاء عشرين
arqam("20", {approx: "about", approxWord: "hawali"})
→حوالي عشرين

Examples

قرابة (the default)
arqam("1000", {currency: "QAR", approx: "about"})
→قرابة ألف ريال قطري
نحو
arqam("1000", {currency: "QAR", approx: "about", approxWord: "nahw"})
→نحو ألف ريال قطري
زهاء
arqam("1000", {currency: "QAR", approx: "about", approxWord: "zuhaa"})
→زهاء ألف ريال قطري

Works with

approx

Notes and rules

  • It has no effect unless approx is "about".

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("20", {approx: "about", approxWord: "x"})
→TypeError: arqam.toWords: approxWord must be one of "", "qurabah", "nahw", "zuhaa", "hawali" (got "x")

Related questions

  • Q552 Can I use «نحو», «زهاء» or «حوالَيْ» instead of «قرابة»?

See also

approx

12.10.36 approxRound

12.10 Options › approxRound

with approx: round first to this many significant digits

Format

arqam(number, {approxRound: value})
new arqam.NumberFormat("ar", {approxRound: value}).format(number)
arqam.config({approxRound: value})
Values"" | a number
Default""
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

With approx: the number rounded first to so many significant digits.

Purpose and when to use it

  • «قرابة مليون» from 987,450.
  • Headlines.

Values

ValueMeaning
"" defaultwith approx: round first to this many significant digits
a number

Examples

Two significant digits
arqam("987450", {currency: "QAR", approx: "about", approxRound: 2})
→قرابة تسعمائة وتسعين ألف ريال قطري
One
arqam("987450", {currency: "QAR", approx: "about", approxRound: 1})
→قرابة مليون ريال قطري

Works with

approx

Notes and rules

  • It has no effect without approx.

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("987450", {currency: "QAR", approx: "about", approxRound: "x"})
→TypeError: arqam.toWords: approxRound must be a whole number of 0 or more (got "x")

Related questions

  • Q557 Can Arqam round the number first?

See also

approx

12.10.37 errorLanguage

12.10 Options › errorLanguage

the language of the error messages: English (the default) or Arabic; the English text stays in error.english

Format

arqam(number, {errorLanguage: value})
new arqam.NumberFormat("ar", {errorLanguage: value}).format(number)
arqam.config({errorLanguage: value})
Values"" | "en" | "ar"
Default""
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

The language of the error messages: "" or "en" English, "ar" Arabic.
The message keeps its prefix (arqamAR: …), and the English text stays in error.english.

Purpose and when to use it

  • Showing errors to Arabic readers.
  • Logging the English text while showing the Arabic.

Values

Value
"" default
"en"
"ar"

Every value on one example

arqam("20", {errorLanguage: ""})
→عشرون
arqam("20", {errorLanguage: "en"})
→عشرون
arqam("20", {errorLanguage: "ar"})
→عشرون

Works with

config(), every method

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("20", {errorLanguage: "x"})
→TypeError: arqam.toWords: errorLanguage must be one of "", "en", "ar" (got "x")

12.10.38 locale

12.10 Options › locale

the region: its currency, month names, digits, separators and time zone, for every method (12.25)

Format

arqam(number, {locale: value})
new arqam.NumberFormat("ar", {locale: value}).format(number)
arqam.config({locale: value})
Values"" | "ar-QA" | "ar-KM"
Default""
Applies toevery method; toWords takes the region's currency with style "currency"

Description

The region: its digits, separators, month names and time zone for every method, and its currency for an amount (style "currency") (12.25).

Purpose and when to use it

  • One setting for a country: config({locale: "ar-QA"}).
  • A call for another region.

Values

Value
"" default
"ar-QA"
"ar-KM"

Every value on one example

arqam("1500.5", {locale: "", brackets: "end"})
→ألف وخمسمائة، وخمسة أجزاء من العشرة (1,500.5)
arqam("1500.5", {locale: "ar-QA", brackets: "end"})
→ألف وخمسمائة، وخمسة أجزاء من العشرة (1,500.5)
arqam("1500.5", {locale: "ar-KM", brackets: "end"})
→ألف وخمسمائة، وخمسة أجزاء من العشرة (1,500.5)

Examples

Qatar
arqam("1500", {locale: "ar-QA", style: "currency"})
→ألف وخمسمائة ريال قطري
Egypt
arqam("1500", {locale: "ar-EG", style: "currency", brackets: "end"})
→ألف وخمسمائة جنيه مصري (١٬٥٠٠٫٠٠ EGP)
A date
arqam.toDate("2026-11-24", {locale: "ar-IQ"})
→الرابع والعشرون من شهر تشرين الثاني لعام ألفين وستة وعشرين للميلاد

Works with

arabicNumbers, timeZone, currency

Notes and rules

  • A locale alone does not make an amount, as in Intl: give style "currency" to take the region's currency.
  • The 22 Arab regions are listed in 12.25.

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("1500.5", {locale: "x", brackets: "end"})
→RangeError: arqam.toWords: "x" is not a locale such as "ar" or "ar-QA"

Related questions

  • Q401 What does regions give?
  • Q511 Do I need to give a locale or write new?
  • Q514 Why does style "currency" with the locale "ar" give an error?
  • Q519 How do I get the Hijri date or Arabic-Eastern numbers from the locale?
  • Q561 How do I set Arqam up for Qatar (or any Arab country) in one line?
  • Q568 Why does toWords write no riyals after config({locale: "ar-QA"})?

See also

arabicNumbers · timeZone · currency

12.10.39 timeZone

12.10 Options › timeZone

the clock of an exact moment (ISO with Z or an offset, or a Date) in toTime, toDate and toDateTime (12.25)

Format

arqam.toTime(time, {timeZone: value})
arqam.toDate(date, {timeZone: value})
arqam.config({timeZone: value})
Values"" | "asWritten" | "local" | an IANA name
Default""
Applies totoDate, toTime, toDateTime, config(), createArqam()

Description

The clock of an exact moment (ISO with Z or an offset, or a Date) in toTime, toDate and toDateTime (12.25).

Purpose and when to use it

  • A server time shown in Doha time: "Asia/Qatar".
  • The time as written: "asWritten".

Values

Value
"" default
"asWritten"
"local"
an IANA name

Every value on one example

arqam.toTime("2026-11-24T07:30:00Z", {timeZone: ""})
→الساعة السابعة وثلاثون دقيقةً صباحًا
arqam.toTime("2026-11-24T07:30:00Z", {timeZone: "asWritten"})
→الساعة السابعة وثلاثون دقيقةً صباحًا
arqam.toTime("2026-11-24T07:30:00Z", {timeZone: "local"})
→الساعة العاشرة وثلاثون دقيقةً صباحًا بتوقيت مكة المكرمة

Examples

Doha
arqam.toTime("2026-11-24T07:30:00Z", {timeZone: "Asia/Qatar"})
→الساعة العاشرة وثلاثون دقيقةً صباحًا بتوقيت الدوحة
As written
arqam.toTime("2026-11-24T10:30:00+03:00", {timeZone: "asWritten"})
→الساعة العاشرة وثلاثون دقيقةً صباحًا

Works with

zoneName, locale

Notes and rules

  • Only an exact moment (with Z or an offset, or a Date) is moved to the zone; a plain time is written as it is.

Errors

A value that is not one of the above is an error that names the option and its values:

arqam.toTime("2026-11-24T07:30:00Z", {timeZone: "x"})
→RangeError: arqamAR: unknown time zone "x"; give an IANA name such as "Asia/Qatar"

Related questions

  • Q548 What does the style "dateTime" write?
  • Q562 How do I write a time with «بتوقيت الدوحة»?

See also

zoneName · locale

12.10.40 zoneName

12.10 Options › zoneName

how the zone is named after the time: بتوقيت الدوحة (12.25)

Format

arqam.toTime(time, {zoneName: value})
arqam.toDate(date, {zoneName: value})
arqam.config({zoneName: value})
Values"" | "city" | "country" | "offset" | "both" | "off"
Default""
Applies totoDate, toTime, toDateTime, config(), createArqam()

Description

How the zone is named after the time: بتوقيت الدوحة (the city), the country, the offset, both, or not at all.

Purpose and when to use it

  • Travel and meetings: "city".
  • Technical logs: "offset".

Values

Value
"" default
"city"
"country"
"offset"
"both"
"off"

Every value on one example

arqam.toTime("2026-11-24T07:30:00Z", {timeZone: "Asia/Qatar", zoneName: ""})
→الساعة العاشرة وثلاثون دقيقةً صباحًا بتوقيت الدوحة
arqam.toTime("2026-11-24T07:30:00Z", {timeZone: "Asia/Qatar", zoneName: "city"})
→الساعة العاشرة وثلاثون دقيقةً صباحًا بتوقيت الدوحة
arqam.toTime("2026-11-24T07:30:00Z", {timeZone: "Asia/Qatar", zoneName: "country"})
→الساعة العاشرة وثلاثون دقيقةً صباحًا بتوقيت قطر
arqam.toTime("2026-11-24T07:30:00Z", {timeZone: "Asia/Qatar", zoneName: "offset"})
→الساعة العاشرة وثلاثون دقيقةً صباحًا بتوقيت غرينتش ‎+3
arqam.toTime("2026-11-24T07:30:00Z", {timeZone: "Asia/Qatar", zoneName: "both"})
→الساعة العاشرة وثلاثون دقيقةً صباحًا بتوقيت الدوحة (غرينتش ‎+3)
arqam.toTime("2026-11-24T07:30:00Z", {timeZone: "Asia/Qatar", zoneName: "off"})
→الساعة العاشرة وثلاثون دقيقةً صباحًا

Examples

The city
arqam.toTime("2026-11-24T07:30:00Z", {timeZone: "Asia/Qatar", zoneName: "city"})
→الساعة العاشرة وثلاثون دقيقةً صباحًا بتوقيت الدوحة
The offset
arqam.toTime("2026-11-24T07:30:00Z", {timeZone: "Asia/Qatar", zoneName: "offset"})
→الساعة العاشرة وثلاثون دقيقةً صباحًا بتوقيت غرينتش ‎+3
Both
arqam.toTime("2026-11-24T07:30:00Z", {timeZone: "Asia/Qatar", zoneName: "both"})
→الساعة العاشرة وثلاثون دقيقةً صباحًا بتوقيت الدوحة (غرينتش ‎+3)

Works with

timeZone

Notes and rules

  • It has no effect unless a time zone is given.

Errors

A value that is not one of the above is an error that names the option and its values:

arqam.toTime("2026-11-24T07:30:00Z", {timeZone: "Asia/Qatar", zoneName: "x"})
→TypeError: arqamAR: zoneName must be one of "", "city", "country", "offset", "both", "off" (got "x")

Related questions

  • Q563 Can I name the country instead of the city?

See also

timeZone

12.10.41 strict

12.10 Options › strict

throw instead of returning isNaN (12.9)

Format

arqam(number, {strict: value})
new arqam.NumberFormat("ar", {strict: value}).format(number)
arqam.config({strict: value})
Values"off" | "on"
Default"off"
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

A number that cannot be read throws an error instead of giving the isNaN value (12.9).

Purpose and when to use it

  • Checking data before printing a cheque.
  • Off (the default) on a page.

Values

ValueMeaning
"off" defaultnot applied
"on"throw instead of returning isNaN (12.9)

Every value on one example

arqam("12,5", {strict: "off"})
→""
arqam("12,5", {strict: "on"})
→TypeError: arqam.toWords: "12,5" is not a number in the form 1234.56 (digits, an optional ".", and "-" before or "%" after)

Examples

Off (the default)
arqam("12,5")
→""
On
arqam("12,5", {strict: "on"})
→TypeError: arqam.toWords: "12,5" is not a number in the form 1234.56 (digits, an optional ".", and "-" before or "%" after)

Works with

isNaN

Notes and rules

  • The error says what form the number should have.

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("12,5", {strict: "x"})
→TypeError: arqam.toWords: strict must be "on" or "off" (got "x")

Related questions

  • Q39 What do I get for an empty string or text that is not a number?
  • Q274 What if the mark and the input option disagree?
  • Q368 What does strict do?
  • Q414 What does strict: "on" do?
  • Q415 How do I catch the errors?
  • Q416 Are option mistakes errors even without strict?

See also

isNaN

12.10.42 isNaN

12.10 Options › isNaN

returned for a number that cannot be written

Format

arqam(number, {isNaN: value})
new arqam.NumberFormat("ar", {isNaN: value}).format(number)
arqam.config({isNaN: value})
Values"" | any value
Default""
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

What a number that cannot be written gives: "" (the default) or any value.

Purpose and when to use it

  • A table: «—».
  • A form: a message to the user.

Values

ValueMeaning
"" defaultreturned for a number that cannot be written
any value

Examples

The default: empty text
arqam("abc")
→""
A dash
arqam("abc", {isNaN: "—"})
→"—"
A message
arqam("12,5", {isNaN: "رقم غير صحيح"})
→رقم غير صحيح
Not a string: null
JSON.stringify(arqam("abc", {isNaN: null}))
→"null"
A comma instead of a point
arqam("1,5", {isNaN: "—"})
→"—"
Instead, an error
arqam("abc", {strict: "on"})
→TypeError: arqam.toWords: "abc" is not a number in the form 1234.56 (digits, an optional ".", and "-" before or "%" after)

Works with

strict

Notes and rules

  • The value is given back as it is, of any type, so a program can test for it (null, false, a message).
  • A number with a comma, a letter or two points is not a number; the error with strict "on" says what form it should have.
  • config({isNaN: …}) sets it for every call.

Related questions

  • Q39 What do I get for an empty string or text that is not a number?
  • Q40 What do null, undefined, true and NaN give?
  • Q56 What does toWords() return?
  • Q61 How do I know from toParts() that the number was not valid?
  • Q367 What does isNaN do?
  • Q368 What does strict do?

See also

strict

12.10.43 zeroWords

12.10 Options › zeroWords

the words of a zero amount instead of «صفر ريال»: «لا شيء» on some cheques

Format

arqam(number, {zeroWords: value})
new arqam.NumberFormat("ar", {zeroWords: value}).format(number)
arqam.config({zeroWords: value})
Values"" | text
Default""
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

The words written for a zero amount instead of «صفر ريال قطري».
Some banks and forms want «لا شيء» on a cheque of nothing, which cannot be altered into an amount.

«فقط» and «لا غير» are kept around it.

Purpose and when to use it

  • Cheques and receipts of nothing: «فقط لا شيء لا غير».
  • A table where a zero row should read «—» or «لا يوجد».

Values

ValueMeaning
"" defaultthe words of a zero amount instead of «صفر ريال»: «لا شيء» on some cheques
text

Examples

The default
arqam("0", {currency: "QAR"})
→صفر ريال قطري
Nothing
arqam("0", {currency: "QAR", zeroWords: "لا شيء"})
→لا شيء
On a cheque
arqam("0", {currency: "QAR", zeroWords: "لا شيء", prefix: "فقط", suffix: "لا غير"})
→فقط لا شيء لا غير
Less than the minor unit is zero too
arqam("0.004", {currency: "QAR", zeroWords: "لا شيء"})
→لا شيء
Any other amount is unchanged
arqam("0.5", {currency: "QAR", zeroWords: "لا شيء"})
→خمسون درهمًا قطريًا
A plain number
arqam("0", {zeroWords: "—"})
→"—"

Works with

prefix, suffix, currency

Notes and rules

  • Only an amount that is zero in the currency's places is replaced; 0.004 QAR is zero riyals and zero dirhams.
  • The figure in brackets is not written with it.
  • The reader does not read the words back as 0; verify() a zero cheque with the default words.

See also

prefix · suffix · currency

12.10.44 split

12.10 Options › split

colour markers in the words (12.15)

Format

arqam(number, {split: value})
new arqam.NumberFormat("ar", {split: value}).format(number)
arqam.config({split: value})
Values"off" | "on"
Default"off"
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

Colour markers in the words (12.15): the number, the currency and the punctuation each marked, to colour them.

Purpose and when to use it

  • A page that colours the parts.
  • Or formatToParts(), the parts as a list.

Values

ValueMeaning
"off" defaultnot applied
"on"colour markers in the words (12.15)

Every value on one example

arqam("1234.56", {currency: "QAR", split: "off"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا
arqam("1234.56", {currency: "QAR", split: "on"})
→ألف|p و|مائتان وأربعة وثلاثون |cريالًا قطريًا|p، و|f||f|ستة وخمسون |cدرهمًا

Examples

On
arqam("1234.56", {currency: "QAR", split: "on"})
→ألف|p و|مائتان وأربعة وثلاثون |cريالًا قطريًا|p، و|f||f|ستة وخمسون |cدرهمًا
The parts instead of markers
JSON.stringify(arqam.toParts("1234.56", {currency: "QAR"}), ["whole", "fraction"])
→{"whole":"ألف ومائتان وأربعة وثلاثون ريالًا قطريًا","fraction":"، وستة وخمسون درهمًا"}

Works with

tashkeel

Notes and rules

  • The markers are |p punctuation, |c the currency, |f the fraction and | between groups; removing them gives the plain words.

Errors

A value that is not one of the above is an error that names the option and its values:

arqam("1234.56", {currency: "QAR", split: "x"})
→TypeError: arqam.toWords: split must be "on" or "off" (got "x")

Related questions

  • Q75 Can Arqam colour the words?
  • Q76 Where are the colour functions?
  • Q77 How do I colour the groups (thousands, hundreds …) in different colours?
  • Q82 How do I colour the groups and the tanween at the same time?
  • Q85 What do the split markers mean?
  • Q86 Does split change the words?

See also

tashkeel

12.10.45 currDecimal, majorSingle…

12.10 Options › currDecimal, majorSingle…

names for a one-off currency in the same call (registerCurrency is the better way)

Format

arqam(number, {currency: "ZZZ", currDecimal: 2, majorSingle: "…", majorPlural: "…", minorSingle: "…", minorPlural: "…"})
Values—
Default""
Applies totoWords, toParts, NumberFormat, config(), createArqam()

Description

The names of a one-off currency given in the same call: its places, its singular and plural, its minor unit.

Purpose and when to use it

  • A test or a single document.
  • Better for a session: registerCurrency().

Examples

A one-off currency
arqam("2.5", { currency: "ZZZ", currDecimal: 2, majorSingle: "كوكو", majorPlural: "كوكوات", minorSingle: "سنت", minorPlural: "سنتات" })
→كوكوان، وخمسون سنتًا
One and two
arqam("2", { currency: "ZZZ", currDecimal: 2, majorSingle: "كوكو", majorPlural: "كوكوات", minorSingle: "سنت", minorPlural: "سنتات" })
→كوكوان
Eleven: the singular after 11–99
arqam("11.11", { currency: "ZZZ", currDecimal: 2, majorSingle: "كوكو", majorPlural: "كوكوات", minorSingle: "سنت", minorPlural: "سنتات" })
→أحد عشر كوكوًا، وأحد عشر سنتًا
Three places
arqam("5.125", { currency: "ZZZ", currDecimal: 3, majorSingle: "دينار", majorPlural: "دنانير", minorSingle: "فلس", minorPlural: "فلوس" })
→خمسة دنانير، ومائة وخمسة وعشرون فلسًا
The same with registerCurrency()
(arqam.registerCurrency("ZZZ", { // the number currDecimal: 2, // the names, without tashkeel majorSingle: "كوكو", majorPlural: "كوكوات", minorSingle: "سنت", minorPlural: "سنتات" }), arqam("2.5", {currency: "ZZZ"}))
→كوكوان، وخمسون سنتًا

Works with

currency

Notes and rules

  • currDecimal is the number of places of the minor unit (0 for none).
  • majorSingle and majorPlural are required for a code the table does not have; the minor names are needed when currDecimal is more than 0.
  • The dual and the forms after 3–10 and 11–99 are made from the singular and the plural.
  • For more than one call, registerCurrency() is the better way (12.6): the code is then known to every method and to the reader.

See also

currency

12.11 Currencies and units in depth

188 currencies are built in: 173 ISO 4217 codes (every current one, and withdrawn ones for old documents), 2 regional currencies and 13 cryptocurrencies.
Each has its places, names, adjective, gender and symbols:

arqam("1250.5", {currency: "KWD"})
→ألف ومائتان وخمسون دينارًا كويتيًا، وخمسمائة فلس
three places
arqam("2", {currency: "JPY"})
→ينان يابانيان
no fraction
arqam("3", {currency: "SYP"})
→ثلاث ليرات سورية
feminine
arqam("100", {currency: "EUR", tashkeel: "full"})
→مِائَةُ يُورُو
indeclinable
arqam("0.00512", {currency: "BTC"})
→خمسمائة واثنا عشر جزءًا من المائة ألف من البتكوين
crypto: the fraction as given
arqam("0.5", {currency: "MAD", decFormat: "words-words"})
→خمسة أجزاء من العشرة من الدرهم المغربي
the adjective is kept below one

Units of measure are counted nouns too: register them with registerCurrency().
A phrase such as «في الساعة» is a qualifier: it follows the number word, is not declined and is repeated after the minor unit.

A noun that is the first term of an iḍāfa, such as «ملعقة شاي», takes idafa: «شاي» comes right after the noun, which loses its tanween (and the dual its nūn), and الـ moves to it after «من» (من ملعقةِ الشايِ).
A unit with no minor unit takes openDecimals with 0 places, so its decimals are read as typed.

Arqam's page registers its 252 units this way (js/arqamPageUnits.js).

arqam.registerCurrency("KMH", { // the number currDecimal: 3, // the names, without tashkeel majorSingle: "كيلومتر", majorPlural: "كيلومترات", minorSingle: "متر", minorPlural: "أمتار", qualifier: "في الساعة", // the same names with tashkeel qualifierT: "فِي السَّاعَة", // the symbols symbolNative: "كم/س" }) && ""
→""
arqam("1", {currency: "KMH"})
→كيلومتر في الساعة
arqam("2.5", {currency: "KMH", tashkeel: "full"})
→كيلومترَانِ فِي السَّاعَةِ، وَخَمْسُمِائَةِ مترٍ فِي السَّاعَةِ
arqam("12.5", {currency: "KMH", decFormat: "words-words"})
→اثنا عشر كيلومترًا في الساعة، وخمسة أجزاء من العشرة من الكيلومتر في الساعة
arqam("120", {currency: "KMH", brackets: "end", numSymbol: "symbol", currDecForce: "off"})
→مائة وعشرون كيلومترًا في الساعة (120 كم/س)
arqam.registerCurrency("TSP", { // the number currDecimal: 0, openDecimals: true, // the names, without tashkeel majorSingle: "ملعقة", majorPlural: "ملاعق", majorGender: 1, // 1 = feminine idafa: "شاي", // the same names with tashkeel majorSingleT: "مِلْعَقَة", majorPluralT: "مَلَاعِقٍ", idafaT: "شَايٍ" }) && ""
→""
arqam("1", {currency: "TSP"})
→ملعقة شاي
arqam("2", {currency: "TSP"})
→ملعقتا شاي
arqam("11", {currency: "TSP", tashkeel: "full"})
→إِحْدَى عَشْرَةَ مِلْعَقَةَ شَايٍ
arqam("1.25", {currency: "TSP"})
→ملعقة شاي، وخمسة وعشرون جزءًا من المائة من ملعقة الشاي

12.11.1 Currency signs: English, Native and Symbol

Every currency can have three (3) signs beside its ISO code.
English is the sign in Latin letters (QR).

Native is the sign in the country's own script (ر.ق., and грн for Ukraine).
Symbol is one Unicode character, as € is the euro's: eighty-one (81) currencies have one, among them the new signs of the Saudi riyal ⃁, the UAE dirham ⃃ and the Omani rial ⃄.

numSymbol chooses which one is written in the brackets; the default stays the ISO code.

ISO codeEnglishNativeSymbolNote
QARQRر.ق.—
SARSRر.س.⃁U+20C1, Unicode 17.0 (September 2025)
AEDDhد.إ.⃃U+20C3, Unicode 18.0 (September 2026)
OMRORر.ع.⃄U+20C4, Unicode 18.0 (September 2026)
KWDKDد.ك.—
IQD—د.ع.—
USD——$
EUR——€
INRRs.—₹
UAH—грн₴

When the chosen sign is empty. A currency does not have every sign, so the brackets are never left empty:

numSymbolIf it is empty, useIf that is also empty
"code" (default)——
"english"Nativethe ISO code
"native"Englishthe ISO code
"sign"Nativethe ISO code
arqam("1234.5", {currency: "SAR", brackets: "end", numSymbol: "sign"})
→ألف ومائتان وأربعة وثلاثون ريالًا سعوديًا، وخمسون هللةً (1,234.50 ⃁)
arqam("250", {currency: "USD", brackets: "end", numSymbol: "sign"})
→مائتان وخمسون دولارًا أمريكيًا (250.00 $)
arqam("1500", {currency: "QAR", brackets: "end", numSymbol: "sign"})
→ألف وخمسمائة ريال قطري (1,500.00 ر.ق.)
no Symbol: Native
arqam("1500", {currency: "IQD", brackets: "end", numSymbol: "english"})
→ألف وخمسمائة دينار عراقي (1,500.000 د.ع.)
no English: Native
arqam("250", {currency: "USD", brackets: "end", numSymbol: "native"})
→مائتان وخمسون دولارًا أمريكيًا (250.00 USD)
no Native and no English: the ISO code
arqam.symbols.EUR
→"€"
Object.keys(arqam.symbols).length
→81
the currencies with a Symbol

The names "latin" and "symbol" of earlier versions are the same as "english" and "native", and arqam.signs is the same as arqam.symbols.
In NumberFormat, currencyDisplay: "symbol" gives the Symbol, as Intl does ($ for USD).

A Symbol issued later. When a central bank issues a sign, add it with registerCurrency() without waiting for a new Arqam; symbol: "" removes it:

arqam.registerCurrency("QAR", {symbol: "Q"})&&""
→""
arqam("10", {currency: "QAR", brackets: "end", numSymbol: "sign"})
→عشرة ريالات قطرية (10.00 Q)
Q stands in for a future sign
arqam.registerCurrency("QAR", {symbol: ""})&&""
→""
arqam("10", {currency: "QAR", brackets: "end", numSymbol: "sign"})
→عشرة ريالات قطرية (10.00 ر.ق.)

Fonts. A sign can be in the standard before the fonts on a computer can draw it, like a newly approved road sign that not every town has put up yet; many screens still show an empty box.
In formatToParts() the sign is a currency part with sign: true and its codepoint, so a page can give that one character its own font:

JSON.stringify(new arqam.NumberFormat("ar-SA", {style: "currency", currencyDisplay: "sign", brackets: "end"}).formatToParts(5).find(p => p.type === "figure").parts.find(p => p.sign))
→{"type":"currency","value":"⃁","sign":true,"codepoint":"U+20C1"}

Load a font that has the signs for these characters only (unicode-range): the rest of the text is untouched, and the browser downloads the font only when a sign is on the page:

@font-face {
  font-family: "Arqam Signs";
  src: url("/fonts/currency-signs.woff2") format("woff2");
  unicode-range: U+20C1, U+20C3, U+20C4;
}
body { font-family: "Arqam Signs", "Your Arabic font", sans-serif; }

Qatar and Kuwait have no new sign; their native symbols «ر.ق.» and «د.ك.» stay.

12.12 Negatives, percentages, ordinals

A negative number: «سالب» before the words (after a prefix such as فقط) and a minus sign in the brackets.
An amount that is written as 0 has no «سالب».

arqam("-1250.5", {currency: "QAR", prefix: "فقط", brackets: "end"})
→فقط سالب ألف ومائتين وخمسين ريالًا قطريًا، وخمسين درهمًا (-1,250.50 QAR)
arqam(-7, {currency: "QAR", tashkeel: "full"})
→سَالِبُ سَبْعَةِ رِيَالَاتٍ قَطَرِيَّةٍ
arqam("-0.001", {currency: "QAR"})
→صفر ريال قطري
cut to 0 dirhams

A percentage: "25%" or percent: "on".
The decimals are read with فاصلة; there is no currency, prefix or suffix; the figure in brackets keeps its % sign.

arqam("25%")
→خمسة وعشرون بالمائة
arqam("12.05", {percent: "on", brackets: "end"})
→اثنا عشر فاصلة صفر خمسة بالمائة (12.05%)
arqam("100%", {tashkeel: "full", miah: "off"})
→مِئَةٌ بِالْمِئَةِ

An ordinal: ordinal: "masculine" (or "m") or "feminine" (or "f") for whole numbers from 1 to 999,999.
Full tashkeel gives the vowelled forms; prefix, suffix and brackets are not used.

arqam("1", {ordinal: "masculine"})
→الأول
arqam("1", {ordinal: "feminine"})
→الأولى
arqam("11", {ordinal: "masculine"})
→الحادي عشر
arqam("11", {ordinal: "feminine"})
→الحادية عشرة
arqam("21", {ordinal: "feminine"})
→الحادية والعشرون
arqam("101", {ordinal: "masculine"})
→الحادي بعد المائة
arqam("125", {ordinal: "masculine"})
→الخامس والعشرون بعد المائة
arqam("1000", {ordinal: "feminine"})
→الألف
arqam("12", {ordinal: "feminine", tashkeel: "full"})
→الثَّانِيَةَ عَشْرَةَ

The ordinal follows ierab: in the accusative and the genitive the tens take ين and, with full tashkeel, the last vowel changes; the built numbers 11–19, الأولى and the words after «بعد» stay as they are.

arqam("123", {ordinal: "feminine", ierab: "nasb"})
→الثالثة والعشرين بعد المائة
arqam("123", {ordinal: "feminine", ierab: "nasb", tashkeel: "full"})
→الثَّالِثَةَ وَالْعِشْرِينَ بَعْدَ الْمِائَةِ
arqam("123", {ordinal: "feminine", ierab: "jarr", tashkeel: "full"})
→الثَّالِثَةِ وَالْعِشْرِينَ بَعْدَ الْمِائَةِ
arqam("22", {ordinal: "masculine", ierab: "nasb", tashkeel: "full"})
→الثَّانِيَ وَالْعِشْرِينَ
arqam("200", {ordinal: "masculine", ierab: "jarr"})
→المائتين
arqam("3", {ordinal: "masculine", ordinalDefinite: "off", ierab: "nasb", tashkeel: "full"})
→ثَالِثًا

«ال» on an ordinal written as an iḍāfa

Some whole hundreds and thousands are an iḍāfa: a number before the word it counts (ثلاثة آلاف، مائتا ألف).
The grammarians differ on where «ال» goes when such a number is made definite.

OptionGrammariansRule3,000200,000200,001In Arqam
ABasran (the main grammar books)«ال» on the second word only; the number becomes definite through the iḍāfaثلاثة الآلافمائتا الألفالحادي بعد مائتي الألفUsed: Arqam writes A only
BKufan«ال» on both words is also allowedالثلاثة الآلافالمائتا الألفالحادي بعد المائتي الألفfor information; not written
—Common modern writing«ال» on the first word only; most grammar books count it an errorالثلاثة آلافالمائتا ألفالحادي بعد المائتي ألفnot written (an error)

Numbers that are not an iḍāfa keep «ال» on the number: المائة، المائتان، الألف، الألفان، الأحد عشر ألفًا، المائة والثلاثة والعشرون ألفًا.

arqam("3000", {ordinal: "masculine"})
→ثلاثة الآلاف
arqam("200000", {ordinal: "masculine", tashkeel: "full"})
→مِائَتَا الْأَلْفِ
arqam("200000", {ordinal: "masculine", ierab: "jarr"})
→مائتي الألف
arqam("210000", {ordinal: "masculine"})
→المائتان وعشرة الآلاف
arqam("200001", {ordinal: "masculine"})
→الحادي بعد مائتي الألف

Without الـ: ordinalDefinite: "off" (Mohsen Alyafei's ordinalsAr with definite: false). ثاني and حادي are منقوص and lose their ي unless عشر follows; with full tashkeel the words take tanween, except أَوَّلُ and أُولَى, the built numbers and the first term of an iḍāfa.

arqam("1", {ordinal: "masculine", ordinalDefinite: "off"})
→أول
arqam("2", {ordinal: "masculine", ordinalDefinite: "off"})
→ثان
arqam("11", {ordinal: "masculine", ordinalDefinite: "off"})
→حادي عشر
arqam("21", {ordinal: "masculine", ordinalDefinite: "off"})
→حاد وعشرون
arqam("21", {ordinal: "feminine", ordinalDefinite: "off"})
→حادية وعشرون
arqam("125", {ordinal: "masculine", ordinalDefinite: "off"})
→خامس وعشرون بعد مائة
arqam("22", {ordinal: "masculine", ordinalDefinite: "off", tashkeel: "full"})
→ثَانٍ وَعِشْرُونَ

12.13 Fractions

With a currency the fraction is read in its minor unit; in numbers mode as parts (أجزاء من المائة).
decFormat chooses another form.

Extra digits are cut, not rounded, unless rounding: "on".

decFormat
name / short code
numbers: 12.75currency: 12.75 QAR
"auto" / ""
default
اثنا عشر، وخمسة وسبعون جزءًا من المائةاثنا عشر ريالًا قطريًا، وخمسة وسبعون درهمًا
"words-words" / "ww"
word (juz) word
اثنا عشر، وخمسة وسبعون جزءًا من المائةاثنا عشر ريالًا قطريًا، وخمسة وسبعون جزءًا من المائة من الريال
"words-figures" / "wn"
word (juz) number
اثنا عشر، وخمسة وسبعون جزءًا من الـ100اثنا عشر ريالًا قطريًا، وخمسة وسبعون جزءًا من الـ100 من الريال
"figures-words" / "nw"
number (juz) word
اثنا عشر، و75 جزءًا من المائةاثنا عشر ريالًا قطريًا، و75 جزءًا من المائة من الريال
"figures-figures" / "nn"
number (juz) number
اثنا عشر، و75 من الـ100اثنا عشر ريالًا قطريًا، و75 من الـ100 من الريال
"figures" / "n"
word, fasila, number
اثنا عشر، فاصلة 75اثنا عشر ريالًا قطريًا، و75 درهمًا
"decimal" / "d"
word and decimal
اثنا عشر، و0.75اثنا عشر ريالًا قطريًا، و0.75 ريال
"slash" / "/"
word and fraction
اثنا عشر، و75/100اثنا عشر ريالًا قطريًا، و75/100 ريال
"digits" / "sw"
word, fasila, digits
اثنا عشر، فاصلة سبعة، خمسةاثنا عشر ريالًا قطريًا، وخمسة وسبعون درهمًا
"words" / "w"
word, fasila, word
اثنا عشر، فاصلة خمسة وسبعوناثنا عشر ريالًا قطريًا، وخمسة وسبعون درهمًا
arqam("2.675", {currency: "QAR"})
→ريالان قطريان، وثمانية وستون درهمًا
cut
arqam("2.675", {currency: "QAR", rounding: "on"})
→ريالان قطريان، وثمانية وستون درهمًا
rounded
arqam("9.999", {currency: "QAR", rounding: "on"})
→عشرة ريالات قطرية
carried into the whole number
arqam("12.05", {decFormat: "words"})
→اثنا عشر، فاصلة صفر خمسة
leading zeros are read
arqam("0.5", {addZero: "on"})
→صفر، وخمسة أجزاء من العشرة

12.14 The case of the amount in a sentence

The amount takes the case its place in the sentence needs: nominative as a subject, accusative after a verb, genitive after a preposition or as the second term of an iḍāfa.

"المبلغ " + arqam("2000", {currency: "SAR", tashkeel: "full"})
→المبلغ أَلْفَا رِيَالٍ سُعُودِيٍّ
"دفعتُ " + arqam("2000", {currency: "SAR", tashkeel: "full", ierab: "nasb"})
→دفعتُ أَلْفَي رِيَالٍ سُعُودِيٍّ
"بمبلغ " + arqam("2000", {currency: "SAR", tashkeel: "full", ierab: "jarr"})
→بمبلغ أَلْفَي رِيَالٍ سُعُودِيٍّ

Legal form, for contracts and cheques where 302,000 must not be read as 302 or 3,002:

arqam("302000")
→ثلاثمائة ألف وألفان
arqam("302000", {legal: "auto"})
→ثلاثمائة ألف وألفان
arqam("2000000000", {scale: "short"})
→بليونان

Reading order: wordOrder

Classical Arabic often reads a number from its smallest part: units and tens, then hundreds, then thousands.
wordOrder: "small" writes that order.

Each group keeps its own scale word, the Arabic comma goes between groups with comma: "on", and always where the words could otherwise be read two ways (hundreds followed by the units or tens of a larger group: «ستمائة، وستة وخمسون ألفًا» is 56,600; without the comma it also reads 656,000), and the counted noun follows the last (largest) part, so it takes that part's form: «ألفُ ريالٍ», not «ريالًا».
The minor amount follows the same order.

Numbers below 100, single parts (1000, 200) and ordinals do not change; legal form has no effect (every group is already split); compact keeps each group in figures; colours, case and tashkeel work as usual.

arqam("1250", {currency: "QAR", wordOrder: "small"})
→خمسون ومائتان وألف ريال قطري
arqam("1250", {currency: "QAR", tashkeel: "full", wordOrder: "small"})
→خَمْسُونَ وَمِائَتَانِ وَأَلْفُ رِيَالٍ قَطَرِيٍّ
arqam("1234567", {wordOrder: "small"})
→سبعة وستون وخمسمائة، وأربعة وثلاثون ألفًا ومائتا ألف ومليون
arqam("56600", {wordOrder: "small"})
→ستمائة، وستة وخمسون ألفًا
«،» where the words could be read two ways
arqam("1250.125", {currency: "KWD", wordOrder: "small"})
→خمسون ومائتان وألف دينار كويتي، وخمسة وعشرون ومائة فلس
arqam("1003", {currency: "SYP", wordOrder: "small"})
→ثلاث وألف ليرة سورية
the units agree with the noun: ليرة is feminine
arqam("1250", {currency: "AED", wordOrder: "small", ierab: "nasb", prefix: "دفعتُ"})
→دفعتُ خمسين ومائتين وألف درهم إماراتي
arqam("1234567", {wordOrder: "small", compact: "on"})
→567 و234 ألفًا ومليون
arqam.toDate("18/11/2026", {wordOrder: "small", year: "sana"})
→الثامن عشر من شهر نوفمبر سنة ست وعشرين وألفين ميلادية
سنة is feminine: ست، إحدى، اثنتي عشرة
arqam.toDate("1/1/2001", {wordOrder: "small", year: "sana"})
→الأول من شهر يناير سنة إحدى وألفين ميلادية

Without a code, majorGender: 1 gives the numbers for a feminine noun:

arqam("26", {majorGender: 1})
→ست وعشرون
arqam("12", {majorGender: 1, ierab: "jarr"})
→اثنتي عشرة

12.15 Colours: split

With split: "on" the words carry markers that a page turns into colours: |p… punctuation, the prefix and suffix and the brackets; |c… currency names; |f| where the fraction starts; | at every group boundary.
Removing the markers gives exactly the plain words.

arqam("12.5", {currency: "QAR", split: "on"})
→اثنا عشر |cريالًا قطريًا|p، و|f||f|خمسون |cدرهمًا
arqam("12.5", {currency: "QAR", split: "on"}).replace(/\|[pcf]?/g, "")
→اثنا عشر ريالًا قطريًا، وخمسون درهمًا
the markers removed
function arqamColourHTML(marked) {         // |p punctuation · |c currency · |f| fraction · | group
  const esc = t => t.replace(/&/g, "&amp;").replace(/</g, "&lt;");
  let html = "", group = 0, frac = false;
  for (const seg of marked.split("|")) {
    if (seg === "") continue;
    if (seg === "f") { frac = true; continue; }
    if (seg[0] === "p") html += '<span class="punct">' + esc(seg.slice(1)) + "</span>";
    else if (seg[0] === "c") html += '<span class="currency">' + esc(seg.slice(1)) + "</span>";
    else html += '<span class="' + (frac ? "fraction" : "g" + (group++ % 4)) + '">' + esc(seg) + "</span>";
  }
  return html;
}
arqamColourHTML(arqam("1234.56", {currency: "QAR", split: "on"}))
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا

12.16 Recipes

A cheque or invoice line

arqam("12500", { currency: "QAR", prefix: "فقط", suffix: "لا غير", legal: "auto", brackets: "end" })
→فقط اثنا عشر ألفًا وخمسمائة ريال قطري لا غير (12,500.00 QAR)

An invoice with riyals and dirhams apart (toParts)

const p = arqam.toParts("1250.5", {currency: "QAR"});
const riyals  = p.whole;                              // ألف ومائتان وخمسون ريالًا قطريًا
const dirhams = p.fraction.replace(/^،?\s*و/, "");    // خمسون درهمًا

Clause and article numbers

"البند " + arqam("7", {ordinal: "masculine"})
→البند السابع
"المادة " + arqam("21", {ordinal: "feminine"})
→المادة الحادية والعشرون
"الفقرة " + arqam("103", {ordinal: "feminine"})
→الفقرة الثالثة بعد المائة

Many lines, each with its own currency

const lines = [["1250.5", "KWD"], ["99", "USD"], ["0.0042", "BTC"]];
const words = lines.map(([n, code]) => arqam(n, {currency: code}));
words[0]
→ألف ومائتان وخمسون دينارًا كويتيًا، وخمسمائة فلس
words[1]
→تسعة وتسعون دولارًا أمريكيًا
words[2]
→اثنان وأربعون جزءًا من العشرة آلاف من البتكوين

Normalising what the user typed

The library takes the canonical form only.
A small function turns typed text into it (Arqam's page uses a fuller one, toCanonicalNumber() in js/index.js):

function canonical(typed) {                    // "١٬٢٣٤٫٥", "1,234.5", " 1 234.5 " -> "1234.5"
  return String(typed)
    .replace(/[٠-٩]/g, d => "٠١٢٣٤٥٦٧٨٩".indexOf(d))  // Arabic-Eastern numbers
    .replace(/٫/g, ".")                               // Arabic decimal mark
    .replace(/[\s,٬_']/g, "");                        // spaces and thousands separators
}
arqam(canonical("١٬٢٣٤٫٥"))
→ألف ومائتان وأربعة وثلاثون، وخمسة أجزاء من العشرة
arqam(canonical("1,234.5"))
→ألف ومائتان وأربعة وثلاثون، وخمسة أجزاء من العشرة

A server: one-off options, nothing shared

The module keeps its standing options for everyone who imports it.
In a server, pass the options with each call instead of calling config() per user, or give each tenant its own instance with createArqam():

import {toWords, createArqam} from "arqam";
app.get("/words", (req, res) => {
  try { res.json({words: toWords(req.query.n, {currency: req.query.code, strict: "on"})}); }
  catch (e) { res.status(400).json({error: e.message}); }
});
const tenants = {doha: createArqam({currency: "QAR", tashkeel: "full"}), kuwait: createArqam({currency: "KWD"})};
tenants.kuwait.toWords("2.5");   // ديناران كويتيان اثنان، وخمسمائة فلس

12.17 Dates: toDate(date, [options])

arqam.toDate(date)                          // -> string: الثامن عشر من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد
arqam.toDate(date, {calendar, style, ...})  // the options of this call (below)
arqam.toDate([d1, d2, ...], options)        // -> an array of strings, in order
arqam.toDate("18/11/2026")
→الثامن عشر من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد
arqam.toDate("18/11/2026", {calendar: "h"})
→الثامن من شهر جمادى الآخرة لعام ألف وأربعمائة وثمانية وأربعين للهجرة
arqam.toDate("18/11/2026", {calendar: "b", tashkeel: "full"})
→الثَّامِنَ عَشَرَ مِنْ شَهْرِ نُوفَمْبِرَ لِعَامِ أَلْفَيْنِ وَسِتَّةٍ وَعِشْرِينَ لِلْمِيلَادِ، الْمُوَافِقُ الثَّامِنَ مِنْ شَهْرِ جُمَادَى الْآخِرَةِ لِعَامِ أَلْفٍ وَأَرْبَعِمِائَةٍ وَثَمَانِيَةٍ وَأَرْبَعِينَ لِلْهِجْرَةِ
arqam.toDate("18/11/2026", {style: "ordinal"})
→الثامن عشر من شهر نوفمبر سنة 2026 ميلادية
arqam.toDate("18/11/2026", {style: "compact", calendar: "b", arabicNumbers: "on"})
→١٨ نوفمبر ٢٠٢٦م، الموافق ٨ جمادى الآخرة ١٤٤٨هـ
arqam.toDate("1/3/1945", { style: "compact", months: "both", gora: "on", era: "none", arabicNumbers: "on" })
→غرة مارس/آذار ١٩٤٥
the Levant date
arqam.toDate("31/1/1920", {style: "ordinal", months: "both", year: "aam", era: "long"})
→الحادي والثلاثون من شهر يناير/كانون الثاني عام 1920 ميلادي
arqam.toDate("8 جمادى الآخرة 1448", {input: "h", calendar: "b", style: "compact"})
→8 جمادى الآخرة 1448هـ، الموافق 18 نوفمبر 2026م
a Hijri date as input: the input's calendar comes first
arqam.toDate(new Date(2026, 10, 18), {style: "compact", months: "levant"})
→18 تشرين الثاني 2026م
arqam.toDate(["1/1/2026", "x", "1/7/2026"], {style: "compact", calendar: "h"})
→12 رجب 1447هـ""16 محرم 1448هـ
each date on its own; a bad one gives isNaN
OptionValuesWhat it doesExample
calendar"g" "h" "b"the calendar to write: Gregorian, Hijri, or both joined by «الموافق»; by default the calendar the date was read in (Gregorian, or Hijri for a Hijri date)"18/11/2026", {calendar: "b", style: "compact"}
18 نوفمبر 2026م، الموافق 8 جمادى الآخرة 1448هـ
style"words" "ordinal" "compact"day and year in words (default) · day in words, year in figures · figures"18/11/2026", {style: "ordinal"}
الثامن عشر من شهر نوفمبر سنة 2026 ميلادية
months"gulf" "levant" "both" "maghreb" "morocco"يناير (default) · كانون الثاني · يناير/كانون الثاني · جانفي · the Moroccan names"5/8/2026", {style: "compact", months: "morocco"}
5 غشت 2026م
year"liaam" "sana" "aam" "none"the word before the year; default لعام (words), سنة (ordinal), none (compact)"18/11/2026", {style: "compact", year: "aam"}
18 نوفمبر عام 2026م
era"long" "short" "none"after the year: للميلاد / ميلادية / ميلادي (agreeing with the year word) · م / هـ; default long, and short for compact"18/11/2026", {style: "compact", year: "sana", era: "long"}
18 نوفمبر سنة 2026 ميلادية
gora"off" "on"«غرة» for the first day of a month"1/9/1447", {input: "h", calendar: "h", gora: "on"}
غرة شهر رمضان لعام ألف وأربعمائة وسبعة وأربعين للهجرة
input"g" "h"the calendar of the input text; not needed when the year has «هـ» or «م» after it or the month is a Hijri month by name; without any of these the date is Gregorian"18/11/1447", {input: "h", style: "compact"}
18 ذي القعدة 1447هـ
order"dmy" "mdy"dmy (default): 05/06/2026 is 5 June; mdy for month/day/year"12/25/2026", {order: "mdy", style: "compact"}
25 ديسمبر 2026م
ierab"raf" "nasb" "jarr"1.63: the case of the day, given in the call (a standing config() ierab does not apply): raf as a heading or a subject (default) · nasb as an adverb of time (يُعقَدُ الاجتماعُ السادسَ والعشرين…) · jarr after a preposition (في، بتاريخ، حتى)"2026-11-26", {ierab: "jarr", tashkeel: "full"}
السَّادِسِ وَالْعِشْرِينَ مِنْ شَهْرِ نُوفَمْبِرَ لِعَامِ أَلْفَيْنِ وَسِتَّةٍ وَعِشْرِينَ لِلْمِيلَادِ

Every form below reads as the same day (shown here with style: "compact"):

InputFormResult
18/11/2026day/month/year with / - . or a space18 نوفمبر 2026م
2026-11-18ISO: year-month-day18 نوفمبر 2026م
2026-11-18T23:30:00ZISO with a time: the date part, never moved by a time zone18 نوفمبر 2026م
١٨؍١١؍٢٠٢٦Arabic-Eastern or Persian numbers and the Arabic date separator ؍18 نوفمبر 2026م
18 تشرين الثاني 2026a month by name: Gulf, Levant, Maghreb, Moroccan18 نوفمبر 2026م
18 نوفمبر/تشرين الثاني 2026the Levant date18 نوفمبر 2026م
November 18, 2026English month names, full or short18 نوفمبر 2026م
18/11/2026م«م» (or ميلادي، ميلادية، AD، CE) after the year: Gregorian, as without it18 نوفمبر 2026م

A Hijri date as input

Two options decide a date: input is the calendar of the date you give, calendar the calendar the words are written in.
A date is read as Hijri when input: "h" is given, when the year is followed by «هـ», «ه», «هجري», «هجرية» or AH, or when its month is a Hijri month by name (ذو القعدة، رمضان …).

It is then written in Hijri unless calendar asks for Gregorian or both.
«م», «ميلادي», «ميلادية», AD or CE after the year mark a Gregorian date.

A date with no mark and no Hijri month name is Gregorian, whatever its year: Arqam does not guess (1447 is a Gregorian year too).

arqam.toDate("18/11/1447هـ")
→الثامن عشر من شهر ذي القعدة لعام ألف وأربعمائة وسبعة وأربعين للهجرة
«هـ»: read and written as Hijri
arqam.toDate("18 ذو القعدة 1447")
→الثامن عشر من شهر ذي القعدة لعام ألف وأربعمائة وسبعة وأربعين للهجرة
a Hijri month name
arqam.toDate("18/11/1447", {input: "h"})
→الثامن عشر من شهر ذي القعدة لعام ألف وأربعمائة وسبعة وأربعين للهجرة
input "h": written in Hijri
arqam.toDate("18/11/1447هـ", {calendar: "g"})
→الخامس من شهر مايو لعام ألفين وستة وعشرين للميلاد
Hijri to Gregorian
arqam.toDate("18/11/1447هـ", {calendar: "b", style: "compact"})
→18 ذي القعدة 1447هـ، الموافق 5 مايو 2026م
both: the input's calendar first
arqam.toDate("18/11/2026م", {calendar: "h"})
→الثامن من شهر جمادى الآخرة لعام ألف وأربعمائة وثمانية وأربعين للهجرة
Gregorian to Hijri
arqam.toDate("18/11/1447")
→الثامن عشر من شهر نوفمبر لعام ألف وأربعمائة وسبعة وأربعين للميلاد
no mark: Gregorian
arqam.toDate("18/11/1447هـ", {input: "g", strict: "on"})
→TypeError: arqamAR: "18/11/1447هـ": «هـ» marks a Hijri date; leave input out or use input: "h"
a mark that contradicts input is an error
After the yearRead asExampleResult
هـ · ه · هجري · هجرية · AHHijri18/11/1447 هجري18 ذي القعدة 1447هـ
م · ميلادي · ميلادية · AD · CEGregorian18/11/2026 ميلادي18 نوفمبر 2026م
a Hijri month nameHijri18 ذي القعدة 144718 ذي القعدة 1447هـ
nothingGregorian (or input)18/11/202618 نوفمبر 2026م

Refused rather than guessed (here with strict: "on"):

arqam.toDate("18/11/26", {strict: "on"})
→TypeError: arqamAR: "18/11/26": the year must have 4 digits
arqam.toDate("12/25/2026", {strict: "on"})
→RangeError: arqamAR: "12/25/2026" does not exist (the order is day/month/year; use order: "mdy" for month/day/year)
arqam.toDate("31/2/2026", {strict: "on"})
→RangeError: arqamAR: "31/2/2026" does not exist
arqam.toDate("20261118", {strict: "on"})
→TypeError: arqamAR: "20261118" is a plain number, not a date; write "18/11/2026" or "2026-11-18"
arqam.toDate(1763424000000, {strict: "on"})
→TypeError: arqamAR: a number is not a date; give text such as "18/11/2026" or "2026-11-18", or a Date
arqam.toDate("18/11-2026", {strict: "on"})
→TypeError: arqamAR: "18/11-2026" is not a date in the form 18/11/2026 or 2026-11-18
arqam.toDate("الأربعاء 18/11/2026", {strict: "on"})
→TypeError: arqamAR: "الأربعاء 18/11/2026" is not a date in the form 18/11/2026 or 2026-11-18
arqam.toDate("18/11/1447هـ", {input: "g", strict: "on"})
→TypeError: arqamAR: "18/11/1447هـ": «هـ» marks a Hijri date; leave input out or use input: "h"
arqam.toDate("18 نوفمبر 2026هـ", {strict: "on"})
→TypeError: arqamAR: "18 نوفمبر 2026هـ": «هـ» marks a Hijri date, but "نوفمبر" is a Gregorian month
arqam.toDate("30/6/1448", {input: "h", strict: "on"})
→RangeError: arqamAR: "30/6/1448": that Hijri day does not exist (جمادى الآخرة 1448 has 29 days)

12.18 Times and fractions: toTime(), toFraction()

arqam.toTime(time [, {timeStyle, timePeriod, timeSeconds, timeWord, timeParts, ...}])   // -> الساعة الثالثة وخمس وأربعون دقيقةً عصرًا
arqam.toFraction(fraction [, {fractionForm, fractionMixed, fractionSimplify, fractionUnit, code, ...}])   // -> ثلاثة أرباع
// an array gives an array, as for toWords and toDate
arqam.toTime("13:35")
→الساعة الواحدة وخمس وثلاثون دقيقةً ظهرًا
default: the minutes counted
arqam.toTime("13:35", {timeParts: "on"})
→الساعة الواحدة والنصف وخمس دقائق ظهرًا
the hour's parts
arqam.toTime("13:35", {timeStyle: "exact"})
→الساعة الواحدة وخمس وثلاثون دقيقةً مساءً
صباحًا / مساءً only
arqam.toTime("13:35", {timeStyle: "h24"})
→الساعة الثالثة عشرة وخمس وثلاثون دقيقةً
arqam.toTime("0:25")
→الساعة الثانية عشرة وخمس وعشرون دقيقةً بعد منتصف الليل
0:01–0:59: after midnight
arqam.toTime("0:25", {timeParts: "on", tashkeel: "full"})
→السَّاعَةُ الثَّانِيَةَ عَشْرَةَ وَالنِّصْفُ إِلَّا خَمْسَ دَقَائِقَ بَعْدَ مُنْتَصَفِ اللَّيْلِ
arqam.toTime("15:00", {timeStyle: "exact"})
→الساعة الثالثة مساءً
a whole hour: no «تمامًا»
arqam.toTime("15:25", {timeParts: "on", tashkeel: "full"})
→السَّاعَةُ الثَّالِثَةُ وَالنِّصْفُ إِلَّا خَمْسَ دَقَائِقَ عَصْرًا
the half hour less five minutes
arqam.toTime("07:05:30", {timePeriod: "off"})
→الساعة السابعة وخمس دقائق وثلاثون ثانيةً
arqam.toTime("00:30", {timeStyle: "h24"})
→الساعة الثانية عشرة وثلاثون دقيقةً بعد منتصف الليل
arqam.toTime("2:30", {timeStyle: "duration"})
→ساعتان ونصف
arqam.toTime("0:45", {timeStyle: "duration", tashkeel: "full"})
→ثَلَاثَةُ أَرْبَاعِ السَّاعَةِ
arqam.toTime("13:45", {timeStyle: "duration"})
→ثلاث عشرة ساعةً وثلاثة أرباع
arqam.toTime(["1:00", "12:00", "00:00"])
→الساعة الواحدة ليلًاالساعة الثانية عشرة ظهرًامنتصف الليل
arqam.toTime("13:35", {timeStyle: "exact", timeParts: "on"})
→TypeError: arqam.toTime: timeParts applies only to timeStyle "common" (got timeStyle "exact")
timeParts belongs to «common» only

The four clock forms. Words in blue are those that differ between the four forms of the same row; words in black are shared by all four. Shown without tashkeel so they read easily.

Time«مألوف» – parts offdefault«مألوف» – parts ontimeParts: "on"«دقيق»timeStyle: "exact"«24 ساعة»timeStyle: "h24"
0:00منتصف الليلمنتصف الليلمنتصف الليلمنتصف الليل
0:03الساعة الثانية عشرة وثلاث دقائق بعد منتصف الليلالساعة الثانية عشرة وثلاث دقائق بعد منتصف الليلالساعة الثانية عشرة وثلاث دقائق بعد منتصف الليلالساعة الثانية عشرة وثلاث دقائق بعد منتصف الليل
0:25الساعة الثانية عشرة وخمس وعشرون دقيقةً بعد منتصف الليلالساعة الثانية عشرة والنصف إلا خمس دقائق بعد منتصف الليلالساعة الثانية عشرة وخمس وعشرون دقيقةً بعد منتصف الليلالساعة الثانية عشرة وخمس وعشرون دقيقةً بعد منتصف الليل
0:30الساعة الثانية عشرة وثلاثون دقيقةً بعد منتصف الليلالساعة الثانية عشرة والنصف بعد منتصف الليلالساعة الثانية عشرة وثلاثون دقيقةً بعد منتصف الليلالساعة الثانية عشرة وثلاثون دقيقةً بعد منتصف الليل
0:45الساعة الثانية عشرة وخمس وأربعون دقيقةً بعد منتصف الليلالساعة الواحدة إلا الربع بعد منتصف الليلالساعة الثانية عشرة وخمس وأربعون دقيقةً بعد منتصف الليلالساعة الثانية عشرة وخمس وأربعون دقيقةً بعد منتصف الليل
1:00الساعة الواحدة ليلًاالساعة الواحدة ليلًاالساعة الواحدة صباحًاالساعة الواحدة
1:15الساعة الواحدة وخمس عشرة دقيقةً ليلًاالساعة الواحدة والربع ليلًاالساعة الواحدة وخمس عشرة دقيقةً صباحًاالساعة الواحدة وخمس عشرة دقيقةً
3:40الساعة الثالثة وأربعون دقيقةً فجرًاالساعة الرابعة إلا الثلث فجرًاالساعة الثالثة وأربعون دقيقةً صباحًاالساعة الثالثة وأربعون دقيقةً
5:20الساعة الخامسة وعشرون دقيقةً فجرًاالساعة الخامسة والثلث فجرًاالساعة الخامسة وعشرون دقيقةً صباحًاالساعة الخامسة وعشرون دقيقةً
7:00الساعة السابعة صباحًاالساعة السابعة صباحًاالساعة السابعة صباحًاالساعة السابعة
7:05الساعة السابعة وخمس دقائق صباحًاالساعة السابعة وخمس دقائق صباحًاالساعة السابعة وخمس دقائق صباحًاالساعة السابعة وخمس دقائق
11:59الساعة الحادية عشرة وتسع وخمسون دقيقةً صباحًاالساعة الثانية عشرة إلا دقيقة صباحًاالساعة الحادية عشرة وتسع وخمسون دقيقةً صباحًاالساعة الحادية عشرة وتسع وخمسون دقيقةً
12:00الساعة الثانية عشرة ظهرًاالساعة الثانية عشرة ظهرًاالساعة الثانية عشرة ظهرًاالساعة الثانية عشرة
12:01الساعة الثانية عشرة ودقيقة ظهرًاالساعة الثانية عشرة ودقيقة ظهرًاالساعة الثانية عشرة ودقيقة مساءًالساعة الثانية عشرة ودقيقة
13:35الساعة الواحدة وخمس وثلاثون دقيقةً ظهرًاالساعة الواحدة والنصف وخمس دقائق ظهرًاالساعة الواحدة وخمس وثلاثون دقيقةً مساءًالساعة الثالثة عشرة وخمس وثلاثون دقيقةً
15:00الساعة الثالثة عصرًاالساعة الثالثة عصرًاالساعة الثالثة مساءًالساعة الخامسة عشرة
16:50الساعة الرابعة وخمسون دقيقةً عصرًاالساعة الخامسة إلا عشر دقائق عصرًاالساعة الرابعة وخمسون دقيقةً مساءًالساعة السادسة عشرة وخمسون دقيقةً
18:00الساعة السادسة مساءًالساعة السادسة مساءًالساعة السادسة مساءًالساعة الثامنة عشرة
19:45الساعة السابعة وخمس وأربعون دقيقةً مساءًالساعة الثامنة إلا الربع مساءًالساعة السابعة وخمس وأربعون دقيقةً مساءًالساعة التاسعة عشرة وخمس وأربعون دقيقةً
23:58الساعة الحادية عشرة وثمان وخمسون دقيقةً مساءًالساعة الثانية عشرة إلا دقيقتين مساءًالساعة الحادية عشرة وثمان وخمسون دقيقةً مساءًالساعة الثالثة والعشرون وثمان وخمسون دقيقةً

The part of the day by style (timePeriod, on by default; «مدة» has none):

From – to«مألوف» (both forms)«دقيق»«24 ساعة»
0:00منتصف الليلمنتصف الليلمنتصف الليل
0:01 – 0:59بَعْدَ مُنْتَصَفِ اللَّيْلِبَعْدَ مُنْتَصَفِ اللَّيْلِبَعْدَ مُنْتَصَفِ اللَّيْلِ
1:00 – 2:59لَيْلًاصَبَاحًا—
3:00 – 5:59فَجْرًاصَبَاحًا—
6:00 – 11:59صَبَاحًاصَبَاحًا—
12:00ظُهْرًاظُهْرًا—
12:01 – 14:59ظُهْرًامَسَاءً—
15:00 – 17:59عَصْرًامَسَاءً—
18:00 – 23:59مَسَاءًمَسَاءً—
OptionValuesWhat it doesExample
timeStyle"common" "exact" "h24" "duration"as people say it, with the descriptive part of the day (default) · the exact minutes with صباحًا / مساءً · the 24-hour clock (no part of the day) · a length of time"15:40", {timeStyle: "exact"}
الساعة الثالثة وأربعون دقيقةً مساءً
timeParts"off" "on"1.39, «common» only: the hour's parts (والربع، والثلث، والنصف، إلا الربع; «والنصف إلا خمس دقائق» for :25). Off by default: the minutes are counted. With another style it throws a TypeError."15:40", {timeParts: "on"}
الساعة الرابعة إلا الثلث عصرًا
timePeriod"on" "off"the part of the day. 0:01–0:59 is «بعد منتصف الليل» in every clock style. common: ليلًا 1:00–2:59, فجرًا 3:00–5:59, صباحًا 6:00–11:59, ظهرًا 12:00–14:59, عصرًا 15:00–17:59, مساءً 18:00–23:59 · exact: صباحًا 1:00–11:59, ظهرًا 12:00, مساءً 12:01–23:59"20:10", {timePeriod: "on"}
الساعة الثامنة وعشر دقائق مساءً
timeSeconds"on" "off"the seconds, when they are not 00"07:05:30", {timeSeconds: "off"}
الساعة السابعة وخمس دقائق صباحًا
timeWord"on" "off"«الساعة» first"15:45", {timeWord: "off"}
الثالثة وخمس وأربعون دقيقةً عصرًا
ierab"raf" "nasb" "jarr"1.63: the case of the time, given in the call: «في الساعةِ العاشرةِ» (jarr), «الساعةَ العاشرةَ» (nasb); a duration: «ساعتين ونصفًا»"10:00", {ierab: "jarr", tashkeel: "full"}
السَّاعَةِ الْعَاشِرَةِ صَبَاحًا
arqam.toFraction("3/4")
→ثلاثة أرباع
arqam.toFraction("3 1/2")
→ثلاثة ونصف
arqam.toFraction("¾", {tashkeel: "full"})
→ثَلَاثَةُ أَرْبَاعٍ
arqam.toFraction("2/3")
→ثلثان
arqam.toFraction("7/12")
→سبعة أجزاء من اثني عشر
above tenths: «أجزاء من»
arqam.toFraction("3/4", {fractionForm: "math"})
→ثلاثة على أربعة
arqam.toFraction("11/4")
→اثنان وثلاثة أرباع
arqam.toFraction("2.5")
→اثنان ونصف
arqam.toFraction("2 1/2", {currency: "QAR"})
→ريالان قطريان، وخمسون درهمًا
the minor unit, as on cheques
arqam.toFraction("1/2", {currency: "QAR", fractionUnit: "named", tashkeel: "full"})
→نِصْفُ رِيَالٍ قَطَرِيٍّ
the fraction as the first term of an iḍāfa
arqam.toFraction("1/3", {currency: "QAR"})
→ثلث ريال قطري
not exact in dirhams: the fraction word
arqam.toFraction("1/0", {strict: "on"})
→RangeError: arqamAR: the denominator cannot be 0
OptionValuesWhat it doesExample
fractionForm"named" "parts" "math"the fraction nouns for halves to tenths, else «أجزاء من» (default) · always «أجزاء من» · «على»"5/8", {fractionForm: "parts"}
خمسة أجزاء من ثمانية
fractionMixed"on" "off"an improper fraction as a whole number and a fraction (default on)"11/4", {fractionMixed: "off"}
أحد عشر ربعًا
fractionSimplify"off" "on"simplify first (a decimal is always simplified)"6/8", {fractionSimplify: "on"}
ثلاثة أرباع
ierab"raf" "nasb" "jarr"1.63: the case of the fraction, given in the call: ثلثًا، ثلثَ ريالٍ (nasb) · ثلثٍ، ثلثَيْ ريالٍ (jarr)"2/3", {ierab: "jarr", currency: "SAR", fractionUnit: "named", tashkeel: "full"}
ثُلُثَيْ رِيَالٍ سُعُودِيٍّ
emphasisOneTwo"off" "on"with a currency or unit: leave out «واحد/اثنان» after the noun (default off: «كيلومتر ونصف») · keep them («كيلومتر واحد ونصف»)"1 1/2", {currency: "AED", emphasisOneTwo: "on"}
درهم إماراتي واحد، وخمسون فلسًا
fractionUnit"minor" "named"with a currency: the minor unit when the amount is exact (default, as on cheques), else the fraction word · always the fraction word"2 1/2", {currency: "USD", fractionUnit: "named"}
دولاران أمريكيان ونصف

A whole number and a fraction with a unit or a currency

Two rules. 1. The unit's phrase comes last. Ninety-three (93) units have a phrase after the noun («في الساعة»، «في الثانية»، «من الزئبق»، «في المتر المكعب»…).
The fraction now comes before the phrase: «ثلاثة كيلومترات ونصف في الساعة».

There is no option for this: it is a correction.
2. «واحد» and «اثنان» after the counted noun. With one and two the noun comes first and the number after it is an adjective of emphasis (نعت للتوكيد); the singular and the dual already say the number, so the word can be left out: «كيلومتر ونصف»، «ملعقتا شاي ونصف»، as the durations already did («ساعة ونصف»).

The option emphasisOneTwo chooses: "off" leaves it out, "on" keeps it.
By default ("") it is left out, except in the legal form (legal) and the cheque form («فقط» before or «لا غير» after the words), where the number is said twice so that it cannot be altered; toBilingual() and the cheque, invoice and receipt of toClause() write that form.

toFraction() leaves it out unless it is "on".

ValueemphasisOneTwo: "on"default ("off")
km/h, 1 ½
toFraction("1 1/2", {currency: "E04"…})
كيلومتر واحد ونصف في الساعةكيلومتر ونصف في الساعة
km/h, 2 ½
toFraction("2 1/2", {currency: "E04"…})
كيلومتران اثنان ونصف في الساعةكيلومتران ونصف في الساعة
km/h, 3 ½
toFraction("3 1/2", {currency: "E04"…})
ثلاثة كيلومترات ونصف في الساعةثلاثة كيلومترات ونصف في الساعة
km/h, 11 ½
toFraction("11 1/2", {currency: "E04"…})
أحد عشر كيلومترًا ونصف في الساعةأحد عشر كيلومترًا ونصف في الساعة
m/s, 1 ¼
toFraction("1 1/4", {currency: "E01"…})
متر واحد وربع في الثانيةمتر وربع في الثانية
mmHg, 2 ½
toFraction("2 1/2", {currency: "I07"…})
مليمتران اثنان ونصف من الزئبقمليمتران ونصف من الزئبق
kg/m³, 3 ½
toFraction("3 1/2", {currency: "L04"…})
ثلاثة كيلوغرامات ونصف في المتر المكعبثلاثة كيلوغرامات ونصف في المتر المكعب
km (no phrase), 1 ½
toFraction("1 1/2", {currency: "A05"…})
كيلومتر واحد ونصفكيلومتر ونصف
teaspoon, 2 ½
toFraction("2 1/2", {currency: "C21"…})
ملعقتا شاي اثنتان ونصفملعقتا شاي ونصف
QAR, 1 ⅓
toFraction("1 1/3", {currency: "QAR"…})
ريال قطري واحد وثلثريال قطري وثلث
Calldefaultthe cheque form (prefix «فقط»)emphasisOneTwo: "on"
toWords("1", {currency: "EGP"})جنيه مصريفقط جنيه مصري واحدجنيه مصري واحد
toWords("2", {currency: "EGP"})جنيهان مصريانفقط جنيهان مصريان اثنانجنيهان مصريان اثنان
toWords("101", {currency: "EGP"})مائة وجنيه مصريفقط مائة وجنيه مصري واحدمائة وجنيه مصري واحد
toWords("1.01", {currency: "SAR"})ريال سعودي، وهللةفقط ريال سعودي واحد، وهللة واحدةريال سعودي واحد، وهللة واحدة
toWords("2.02", {currency: "TRY"})ليرتان تركيتان، وقرشانفقط ليرتان تركيتان اثنتان، وقرشان اثنانليرتان تركيتان اثنتان، وقرشان اثنان
toWords("21", {currency: "EGP"})واحد وعشرون جنيهًا مصريًافقط واحد وعشرون جنيهًا مصريًاواحد وعشرون جنيهًا مصريًا
toWords("2")اثنانفقط اثناناثنان
Wordإعراب («اشرح»)
كِيلُومِتْرٌمرفوع بالضمة الظاهرة
«كيلومتر» مفرد يدل بلفظه على الواحد، فلا يُذكر بعده «واحد» (الخيار emphasisOneTwo: "off").
وَنِصْفٌالواو حرف عطف؛ معطوف مرفوع بالضمة الظاهرة
«نصف» مفرد يدل على الواحد، فلا يُذكر معه «واحد».
فِيحرف جر مبني على السكون، لا محل له من الإعراب
«في» حرف جر، والاسم بعده مجرور به.
السَّاعَةِاسم مجرور بـ«في» وعلامة جره الكسرة الظاهرة
الاسم بعد حرف الجر مجرور. و«في الساعة» جار ومجرور (شبه جملة) متعلق بمحذوف نعت للمعدود، ويأتي بعد الكسر لأنه وصف للمقدار كله (العدد الصحيح والكسر).
رِيَالَانِمرفوع بالألف لأنه مثنى
«ريالان» مثنى يدل بلفظه على الاثنين، فلا يُذكر بعده «اثنان» (الخيار emphasisOneTwo: "off").
قَطَرِيَّانِنعت لـ«ريال» يتبعه (مرفوع بالألف لأنه مثنى)
النعت يتبع منعوته في إعرابه وعدده وجنسه. والشدة على ياء النسبة.

Notes for developers: a number with no noun keeps «واحد» («واحد وعشرون»، toWords("1")); from three upwards nothing changes; with a currency, an amount exact in the minor unit is written as on cheques («ريالان قطريان، وخمسون درهمًا»), «اثنان» following the option; split: "on" and toParts() follow the option; the page has the switch «ذكر واحد واثنين بعد المعدود» (off by default) for amounts; the reader reads the noun alone as one or two (ريالان قطريان = 2).

On the page they are the types «الوقت» and «الكسور» (with «وقت» and «كسر» in «سريع», which reads 15:45 as a time and 3/4 or 3 ½ as a fraction); a fraction typed for an amount or a unit (2 ½ QAR، 3 ½ كم) is written by toFraction() with that currency or unit.
«مستندات» can add the time to the date line.

12.19 Words back to numbers: arqamWordsToNumbers

The other direction, as a sub-library of Arqam: arqamWordsToNumbers.js (script, loaded after arqamAR.js) or dist/arqamWordsToNumbers.mjs (module; import wordsToNumbers, {find, value, verify} from "arqam/words" brings the engine with it).
It needs arqamAR 1.27 or later and uses only what the engine exposes: the currency names, larger scale names and ordinal words come from toWords(), so a currency added with registerCurrency() is read too.

It finds the numbers written in words inside any text and writes them in digits, leaving the rest of the text as it is: formal Arabic with or without tashkeel, either reading order, and the spellings people write in the Maghreb, Egypt, the Levant, the Gulf and Yemen.
It reads the words around a number too: fractions and decimals, سالب, percentages, digits before a scale word, currencies with their minor unit, and ordinals when asked.

Values are text, exact, never rounded.

wordsToNumbers(text [, options])          // -> the text with each number in digits
wordsToNumbers.find(text [, options])     // -> [{start, end, text, value, negative?, percent?, currency?, noun?, places?, ordinal?}]
wordsToNumbers.value(text [, options])    // -> "1250.5" if the whole text is one number, else null
wordsToNumbers.verify(words, number [, {currency: code, ...options}])   // -> {ok, reason, read, expected, currency, issue, difference, expectedWords}
wordsToNumbers("لدي ألفان وخمسمائة ريال وثلاثة كتب")
→لدي 2500 ريال و3 كتب
wordsToNumbers("خمستاشر ومية وتنين وجوج وربعين")
→15 و102 و42
dialects
wordsToNumbers("سبعين وثمان مائة واثنين وعشرين ألفا وثمانية ملايين")
→"8022870"
smallest first
wordsToNumbers("مليونين ونص، وثلاثة إلا ربع")
→2500000، و2.75
fractions
wordsToNumbers("سالب اثني عشر فاصلة خمسة بالمائة")
→"-12.5%"
wordsToNumbers("2 مليون و1.5 مليار")
→2000000 و1500000000
digits and a scale word
wordsToNumbers("ألف، ومائتان وخمسون ريالًا قطريًا، وخمسون درهمًا")
→1250 ريالًا قطريًا، و50 درهمًا
currency words kept
wordsToNumbers("ألف، ومائتان وخمسون ريالًا قطريًا، وخمسون درهمًا", {currency: "code"})
→"1250.50 QAR"
wordsToNumbers("البند الخامس والعشرون بعد المائة", {ordinals: "on"})
→البند 125
wordsToNumbers("مائتان وألف")
→"201000"
201,000: the short form toWords writes
wordsToNumbers("مائتان وألف", {order: "small"})
→"1200"
1200: the classical order, as in «سنة مائتين وألف»
JSON.stringify(wordsToNumbers.find("لدي ألفان وخمسمائة ريال"))
→[{"start":4,"end":23,"text":"ألفان وخمسمائة ريال","value":"2500","currency":null,"noun":"ريال"}]
wordsToNumbers.value("تسعمائة وتسعة وتسعون ألفًا")
→"999000"
JSON.stringify(wordsToNumbers.verify("فقط ألف، ومائتان وخمسون ريالًا قطريًا، وخمسون درهمًا لا غير", "1250.50", {currency: "QAR"}))
→{"ok":true,"reason":"match","read":"1250.5","expected":"1250.5","currency":"QAR","issue":"match","difference":"0","expectedWords":"ألف ومائتان وخمسون ريالًا قطريًا، وخمسون درهمًا"}
the cheque check
JSON.stringify(wordsToNumbers.verify("ألف ومائتان وخمسون ريالًا", "1250.05"))
→{"ok":false,"reason":"different","read":"1250","expected":"1250.05","currency":null,"issue":"subunit","difference":"-0.05","expectedWords":"ألف ومائتان وخمسون، وخمسة أجزاء من المائة"}
wordsToNumbers.verify("ألف ريال قطري، وخمسون درهما", "1250.75", {currency: "QAR"}).issue
→"both"
both the riyals and the dirhams differ
wordsToNumbers.verify("ألف ومائتان وخمسون ريالا قطريا، وخمسون درهما", "1250.75", {currency: "QAR"}).issue
→"subunit"
only the dirhams
wordsToNumbers.verify("ألف ريال قطري، وخمسون درهما", "1250.75", {currency: "QAR"}).difference
→"-250.25"
the words minus the figure
wordsToNumbers.verify("ألف ريال قطري، وخمسون درهما", "1250.75", {currency: "QAR"}).expectedWords
→ألف ومائتان وخمسون ريالًا قطريًا، وخمسة وسبعون درهمًا
the figure in words

Hundreds followed by «وألف» or «وألفان». Words such as «مائة وألف», «ثلاثمائة وألفان» or «مائتان ومليار» can be read two ways: largest first, as the short form of 101,000, 302,000 and 201,000,000,000 (how toWords() writes them); or smallest first, as 1,100, 2,300 and 1,000,000,200 (the classical order, as in «سنة مائتين وألف»).
The reader takes the largest-first reading, so value() and verify() always accept the engine's own words.

It takes the classical reading where the text shows that order (units or tens before the hundreds: «اثنان وعشرون وتسعمائة وألف» is 1,922; a comma after a group: «ستمائة، وستة وخمسون ألفًا» is 56,600), and with order: "small".
To write such amounts so that no reader can misread them, use legal: "auto" in toWords(): «مائة ألف وألف».

wordsToNumbers.value("ثلاثمائة وألفان")
→"302000"
wordsToNumbers.verify(arqam("302000"), "302000").ok
→true
wordsToNumbers.value("ثلاثمائة وألفان", {order: "small"})
→"2300"
arqam("302000", {legal: "auto"})
→ثلاثمائة ألف وألفان

verify() says what differs: issue is "match", "whole" (the whole units differ), "subunit" (only the fraction), "both", "currency", "none" (no amount in the words) or "several"; difference is what the words say minus the figure (null when the words give no single amount); expectedWords is the figure in words.
A mismatch is reported, never judged.

OptionValuesMeaning
order"auto" "large" "small"the reading order; auto: the one that reads the text as fewer numbers, and on a tie largest first (مائة وألف = 101,000)
scale"short" "long"short: مليار = بليون = 10^9; long: بليون = 10^12
currency"words" "code" "off"keep the currency words · write «1250.50 QAR» · read no currency
ordinals"off" "on"read ordinals (off: الأول and الثاني are ordinary words too)
dates"on" "off"0.95: read a date whole: «الثامن عشر من شهر نوفمبر لعام …» → 18/11/2026م (off: the 0.94 reading, the year alone)
times"on" "off"0.95: read a time or a duration whole: «الساعة الثالثة وخمس عشرة دقيقة عصرًا» → 15:15, «ساعتان ونصف» → 2:30
arabicNumbers"off" "on"write ٠١٢٣
zero"off" "on"read صفر as 0
ambiguous"off" "on"also read alone the words that are ordinary words too (مياه، متين، وحده …)

A number word must end where its word ends (ستار، عشرات، ثمانينات stay words); «ثلث القصة» and «ربع» alone stay words, and a fraction is read after a number: «خمسة وثلث» → 5 1/3.
«ميه» and «ميتين» are numbers even alone.

A value whose fraction has no exact decimal is a mixed number.

Dates, times and durations

Everything toDate() and toTime() write is read back whole: every style, case, tashkeel, month-name set, «غرة», the year in words or figures, and the two dates joined by «الموافق» (two items).
A date gives the figures of Arqam's compact style, 18/11/2026م or 18/11/1447هـ, which toDate() reads back as the same day, with kind: "date", calendar ("g" or "h") and iso (the Gregorian day).

A time gives the 24-hour clock, 15:15 (seconds when written), with kind: "time"; the part of the day (صباحًا، عصرًا، مساءً …) decides the hour, and without it a time that can be morning or afternoon is given on the 12-hour clock (3:15) with hour12: true.
A duration gives hours and minutes, 2:30, with kind: "duration".

An hour without «الساعة» (الثالثة) is read as a time only with its minutes or the part of the day, as it is an ordinary ordinal too; «ساعة» and «دقيقة» alone stay words.
dates: "off" and times: "off" give the 0.94 reading.

wordsToNumbers("حُرِّر هذا العقد في الثامن عشر من شهر نوفمبر لعام ألفين وستة وعشرين")
→حُرِّر هذا العقد في 18/11/2026م
a date
wordsToNumbers("الثامن عشر من شهر ذي القعدة لعام ألف وأربعمائة وسبعة وأربعين للهجرة، الموافق الخامس من شهر مايو لعام ألفين وستة وعشرين للميلاد")
→18/11/1447هـ، الموافق 5/5/2026م
both calendars: two dates
wordsToNumbers("يبدأ الاجتماع الساعة الثالثة وخمس عشرة دقيقة عصرًا ويستمر ساعتين ونصفًا")
→يبدأ الاجتماع 15:15 ويستمر 2:30
a time and a duration
wordsToNumbers("الساعة الثالثة وخمس عشرة دقيقة")
→"3:15"
no part of the day: 12-hour
JSON.stringify(wordsToNumbers.find("غرة شهر رمضان لعام ألف وأربعمائة وسبعة وأربعين"))
→[{"start":0,"end":46,"text":"غرة شهر رمضان لعام ألف وأربعمائة وسبعة وأربعين","value":"1/9/1447هـ","kind":"date","calendar":"h","iso":"2026-02-18"}]
the fields of a date
wordsToNumbers("الثامن عشر من شهر نوفمبر لعام ألفين وستة وعشرين", {dates: "off"})
→الثامن عشر من شهر نوفمبر لعام 2026
dates off: the year alone

Both directions on one object: once the reader is loaded, arqamAR also has fromWords(text [, options]) (the reader's value()), findNumbers(text [, options]) (find()) and verify(words, number [, options]).
They take the reader's options; instances made with createArqam() do not get them.

arqam.fromWords(arqam("1250.5", {currency: "QAR"}), {currency: "code"})
→"1250.5"
JSON.stringify(arqam.findNumbers("بعت ثلاثة وأخذت عشرين").map(m => m.value))
→["3","20"]
arqam.verify("فقط ألف ومائتان وخمسون ريالًا قطريًا لا غير", "1250", {currency: "QAR"}).ok
→true

12.20 Explain the grammar: arqamExplain

Every word Arqam writes, with its case (الإعراب), why it has that form, the rule and comparisons.
A sub-library like the reader: arqamExplain.js after arqamAR.js, or import {explain} from "arqam/explain"; once loaded, arqam.explain(number, options) is there too.

It takes the options of toWords() and returns {text, words, rules, order}: each word has part (number, scale, noun, adjective, qualifier, idafa, separator, word), short (the case in one line), why, rules and compare.
On the page it is the «اشرح» button under the words: each word on a numbered line with its case, then the rules used as numbered lines.

Version 0.4 explains numbers, currencies, units (with their phrases such as «في الثانية» and «ملعقة شاي»), decimals read in parts, ordinals ({ordinal: "masculine"}) and dates: arqam.explain.date("2026-11-16", {calendar: "b"}) explains the words of toDate().
TypeScript: dist/arqamExplain.d.mts declares the result (ArqamExplanation, ArqamExplainWord, ArqamExplainPart).

arqam.explain("1253.75", {currency: "EGP"}).words.map(w => w.word + " = " + w.short).join(" | ")
→ألف = مرفوع بالضمة الظاهرة | ومائتان = الواو حرف عطف؛ معطوف مرفوع بالألف لأنه مثنى | وثلاثة = الواو حرف عطف؛ معطوف مرفوع بالضمة الظاهرة | وخمسون = الواو حرف عطف؛ معطوف مرفوع بالواو لأنه ملحق بجمع المذكر السالم | جنيهًا = تمييز منصوب بالفتحة الظاهرة | مصريًا = نعت لـ«جنيه» يتبعه (منصوب بالفتحة الظاهرة) | ، = علامة ترقيم، لا محل لها من الإعراب | وخمسة = الواو حرف عطف؛ معطوف مرفوع بالضمة الظاهرة | وسبعون = الواو حرف عطف؛ معطوف مرفوع بالواو لأنه ملحق بجمع المذكر السالم | قرشًا = تمييز منصوب بالفتحة الظاهرة
arqam.explain("13", {currency: "SYP"}).words[0].why
→الجزء الأول من 13 يخالف المعدود: «ليرة» مؤنث فجاء بلا تاء.
arqam.explain("3000000", {tashkeel: "full"}).words[1].short
→مضاف إليه مجرور بالفتحة نيابة عن الكسرة لأنه ممنوع من الصرف
Object.values(arqam.explain("1253.75", {currency: "MAD"}).rules).map(r => r.title).join("، ")
→المرتبة وحدها: ألف، مليون، إعراب العدد حسب موقعه، مائتان مثنى، العطف بالواو، 3–10 تخالف المعدود، العقود كجمع المذكر السالم، المعدود بعد 11–99، المعدود يتبع آخر أجزاء العدد، النعت يتبع المنعوت، الكسر بالوحدة الصغرى

Times, fractions and ranges are explained too: arqam.explain.time(time, options) with the toTime() options, arqam.explain.fraction(fraction, options) with the toFraction() options, and arqam.explain.range(from, to, options) with the options of NumberFormat (every style).
In a time, «الساعةُ» is «خبر لمبتدأ محذوف تقديره «الوقتُ»», the hour (an ordinal) is its نعت, the minutes are معطوف on «الساعة», and «صباحًا / عصرًا» is a ظرف زمان.

In a range, «من» and «إلى» are prepositions and both values are مجرور after them.

arqam.explain.time("15:45").words.map(w => w.word + " = " + w.short).join(" | ")
→الساعة = خبر لمبتدأ محذوف تقديره «الوقتُ» مرفوع بالضمة الظاهرة | الثالثة = نعت لـ«الساعة» مرفوع بالضمة الظاهرة | وخمس = الواو حرف عطف؛ معطوف على «الساعة» مرفوع بالضمة الظاهرة | وأربعون = الواو حرف عطف؛ معطوف مرفوع بالواو لأنه ملحق بجمع المذكر السالم | دقيقةً = تمييز منصوب بالفتحة الظاهرة | عصرًا = ظرف زمان منصوب بالفتحة الظاهرة
arqam.explain.time("3:40 pm", {timeParts: "on"}).words.map(w => w.word + " = " + w.short).join(" | ")
→الساعة = خبر لمبتدأ محذوف تقديره «الوقتُ» مرفوع بالضمة الظاهرة | الرابعة = نعت لـ«الساعة» مرفوع بالضمة الظاهرة | إلا = أداة استثناء مبنية على السكون، لا محل لها من الإعراب | الثلث = مستثنى منصوب بالفتحة الظاهرة | عصرًا = ظرف زمان منصوب بالفتحة الظاهرة
arqam.explain.fraction("2/3", {currency: "QAR"}).words.map(w => w.word + " = " + w.short).join(" | ")
→ثلثا = مرفوع بالألف لأنه مثنى، وحُذفت نونه للإضافة | ريال = مضاف إليه مجرور بالكسرة الظاهرة | قطري = نعت لـ«ريال» مجرور بالكسرة الظاهرة
arqam.explain.fraction("7/12").words.map(w => w.word + " = " + w.short).join(" | ")
→سبعة = مرفوع بالضمة الظاهرة، وهو مضاف | أجزاء = مضاف إليه مجرور بالكسرة | من = حرف جر مبني على السكون، وحُرّك بالكسر لالتقاء الساكنين، لا محل له من الإعراب | اثني = الجزء الأول من «اثني عشر»: يُعرب إعراب المثنى، مجرور بالياء | عشر = الجزء الثاني من عدد مركب مبني على فتح الجزأين في محل جر
arqam.explain.range(5, 10, {currency: "QAR"}).words.map(w => w.word + " = " + w.short).join(" | ")
→من = حرف جر مبني على السكون، لا محل له من الإعراب | خمسة = مجرور بـ«من» وعلامة جره الكسرة الظاهرة، وهو مضاف | ريالات = مضاف إليه مجرور بالكسرة | قطرية = نعت لـ«ريال» يتبعه (مجرور بالكسرة) | إلى = حرف جر مبني على السكون، لا محل له من الإعراب | عشرة = مجرور بـ«إلى» وعلامة جره الكسرة الظاهرة، وهو مضاف | ريالات = مضاف إليه مجرور بالكسرة | قطرية = نعت لـ«ريال» يتبعه (مجرور بالكسرة)

12.21 The Intl-style formatter: arqam.NumberFormat

arqam.NumberFormat works like JavaScript's own Intl.NumberFormat, but writes Arabic words, not figures.
You make a formatter once, with a locale and options, and call its format() for each number: useful for tables, invoices and lists.

It has no grammar of its own: format() calls toWords(), toFraction(), toTime() or toDate(), so the words are always those of the methods, which all stay.
The locale is optional ("ar"), an object as the first argument is the options, and new is optional.

// a script tag                                // an ES module
<script src="arqamAR.js"></script>             import arqam, {NumberFormat} from "arqam";
<script src="arqamUnits.js"></script>          import "arqam/units";   // only for style "unit"

The forms of the call

arqam.NumberFormat().format(2500)
→ألفان وخمسمائة
no locale: "ar"; no new
new arqam.NumberFormat("ar").format(2500)
→ألفان وخمسمائة
the same
arqam.NumberFormat({tashkeel: "full"}).format(2500)
→أَلْفَانِ وَخَمْسُمِائَةٍ
an object first is the options
new arqam.NumberFormat("ar-QA", {style: "currency"}).format(1234.5)
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وخمسون درهمًا
the currency of the locale's country
JSON.stringify([1, 2, 3].map(arqam.NumberFormat({style: "ordinal"}).format))
→["الأول","الثاني","الثالث"]
format is bound, as in Intl
JSON.stringify(arqam.NumberFormat().format(["1", "2"]))
→["واحد","اثنان"]
an array gives an array

The eight styles

styleWhat it writesThe same asIn Intl
"decimal"numbers (the default)toWords(n)yes
"percent"a share of one as a percentage: 0.125 is 12.5%toWords("12.5%")yes
"currency"amounts: the currency of the locale's country, or currencytoWords(n, code)yes
"unit"units of measure (with the units add-on)the page's unitsyes
"ordinal"ordinals, masculine by defaulttoWords(n, {ordinal})no
"fraction"typed fractionstoFraction(f)no
"time"the time of day or a durationtoTime(t)no (DateTimeFormat)
"date"dates, Gregorian or HijritoDate(d)no (DateTimeFormat)
arqam.NumberFormat({style: "percent"}).format(0.125)
→ثلاثة عشر بالمائة
arqam.NumberFormat({style: "percent"}).format(0.07)
→سبعة بالمائة
worked out in text: no 7.000000000000001
arqam.NumberFormat({currency: "KWD"}).format("12.345")
→اثنا عشر دينارًا كويتيًا، وثلاثمائة وخمسة وأربعون فلسًا
arqam.NumberFormat("ar-SA", {style: "currency"}).format(2500)
→ألفان وخمسمائة ريال سعودي
arqam.NumberFormat({style: "unit", unit: "kilometer"}).format(12.5)
→اثنا عشر كيلومترًا، وخمسمائة متر
an Intl unit name
arqam.NumberFormat({style: "unit", unit: "kilometer-per-hour"}).format(120)
→مائة وعشرون كيلومترًا في الساعة
arqam.NumberFormat({style: "unit", unit: "ملعقة شاي"}).format(3)
→ثلاث ملاعق شاي
or the Arabic name, or the key (C21)
arqam.NumberFormat({style: "ordinal", ordinal: "feminine"}).format(21)
→الحادية والعشرون
arqam.NumberFormat({style: "fraction"}).format("3 1/2")
→ثلاثة ونصف
arqam.NumberFormat({style: "time", timeStyle: "exact"}).format("15:45")
→الساعة الثالثة وخمس وأربعون دقيقةً مساءً
arqam.NumberFormat("ar-u-ca-islamic", {style: "date"}).format("2026-11-21")
→الحادي عشر من شهر جمادى الآخرة لعام ألف وأربعمائة وثمانية وأربعين للهجرة
-u-ca-islamic: the Hijri calendar
arqam.NumberFormat({style: "date", calendar: "both", dateForm: "compact"}).format("2026-11-21")
→21 نوفمبر 2026م، الموافق 11 جمادى الآخرة 1448هـ
toDate's style is dateForm here

The units file: the fields of a unit

Each unit in src/arqamUnits.js is written with named fields instead of array positions, and a field that is empty is left out (0 for decimals, majorGender and minorGender).
"Major" is the unit itself (كيلومتر); "minor" is its smaller part (متر), as in a currency (ريال / درهم).

The fields have the same names as the attributes of registerCurrency() (12.11), so a unit reads like a currency.
The examples below are read from the file when the manual is written.

FieldPosition in js/data.jsMeaningExample (unit)
decimals0Decimal places of the minor unit: 3 means 1 major = 1,000 minor. Left out: no minor unit; decimals are read as an open fraction.3 (A05) كيلومتر
The names, without vowel marks
majorSingle1The unit, singular"كيلومتر" (A05)
majorPlural3The unit, plural"كيلومترات" (A05)
minorSingle5The minor unit, singular"متر" (A05)
minorPlural7The minor unit, plural"أمتار" (A05)
The second word of each name (an adjective, a qualifier or an iḍāfa word; see secondAs)
majorSingleC2Second word of majorSingle"هجرية" (F10) سنة هجرية
majorPluralC4Second word of majorPlural"هجرية" (F10) سنوات هجرية
minorSingleC6Second word of minorSingle"في الساعة" (E04) متر في الساعة
minorPluralC8Second word of minorPlural"في الساعة" (E04) أمتار في الساعة
The same names with vowel marks (tashkīl), used when vowel marks are switched on
majorSingleT9majorSingle with vowel marks"كِيلُومِتْر" (A05)
majorPluralT11majorPlural with vowel marks"كِيلُومِتْرَاتٍ" (A05)
minorSingleT13minorSingle with vowel marks"مِتْر" (A05)
minorPluralT15minorPlural with vowel marks"أمْتَارٍ" (A05)
majorSingleCT10majorSingleC with vowel marks"هِجْرِيَّة" (F10)
majorPluralCT12majorPluralC with vowel marks"هِجْرِيَّةٍ" (F10)
minorSingleCT14minorSingleC with vowel marks"فِي السَّاعَة" (E04)
minorPluralCT16minorPluralC with vowel marks"فِي السَّاعَة" (E04)
Gender (decides ثلاثة / ثلاث)
majorGender171 = the unit is feminine. Left out: masculine.1 (A09) ياردة
minorGender181 = the minor unit is feminine. Left out: masculine.1 (F14) قرن: سنة
Symbols (shown in brackets after the words)
symbolNative19The Arabic symbol"كم" (A05)
symbolLatin20The Latin-script symbol. Left out: symbolNative is used."كم" (A05)
How the second word is read
secondAs21"qualifier": comes once, after the whole number phrase («مائة كيلومتر في الساعة»); only majorSingleC/CT are used."qualifier" (E04)
"idafa": an iḍāfa joined to the noun («ثلاث ملاعق شاي»); only majorSingleC/CT are used."idafa" (C21) ملعقة شاي
Left out: each name takes its own second word as an adjective, unless majorSingleC begins with «في ال», «لكل» or «من», which is then read as a qualifier.(F10) سنة هجرية
"A05":{decimals:3, majorSingle:"كيلومتر", majorPlural:"كيلومترات", minorSingle:"متر", minorPlural:"أمتار", majorSingleT:"كِيلُومِتْر", majorPluralT:"كِيلُومِتْرَاتٍ", minorSingleT:"مِتْر", minorPluralT:"أمْتَارٍ", symbolNative:"كم", symbolLatin:"كم"},
"A09":{majorSingle:"ياردة", majorPlural:"ياردات", majorSingleT:"يَارِدَة", majorPluralT:"يَارِدَاتٍ", majorGender:1},
"C21":{majorSingle:"ملعقة", majorPlural:"ملاعق", majorSingleC:"شاي", majorPluralC:"شاي", majorSingleT:"مِلْعَقَة", majorPluralT:"مَلَاعِقِ", majorSingleCT:"شَايٍ", majorPluralCT:"شَايٍ", majorGender:1, secondAs:"idafa"},"C22":{majorSingle:"ملعقة", majorPlural:"ملاعق", majorSingleC:"مائدة", majorPluralC:"مائدة", majorSingleT:"مِلْعَقَة", majorPluralT:"مَلَاعِقِ", majorSingleCT:"مَائِدَةٍ", majorPluralCT:"مَائِدَةٍ", majorGender:1, secondAs:"idafa"},
"E04":{decimals:3, majorSingle:"كيلومتر", majorPlural:"كيلومترات", minorSingle:"متر", minorPlural:"أمتار", majorSingleC:"في الساعة", majorPluralC:"في الساعة", minorSingleC:"في الساعة", minorPluralC:"في الساعة", majorSingleT:"كِيلُومِتْر", majorPluralT:"كِيلُومِتْرَاتٍ", minorSingleT:"مِتْر", minorPluralT:"أمْتَارٍ", majorSingleCT:"فِي السَّاعَة", majorPluralCT:"فِي السَّاعَة", minorSingleCT:"فِي السَّاعَة", minorPluralCT:"فِي السَّاعَة", symbolNative:"كم/س", symbolLatin:"كم/س", secondAs:"qualifier"},"E05":{decimals:3, majorSingle:"كيلومتر", majorPlural:"كيلومترات", minorSingle:"متر", minorPlural:"أمتار", majorSingleC:"في الثانية", majorPluralC:"في الثانية", minorSingleC:"في الثانية", minorPluralC:"في الثانية", majorSingleT:"كِيلُومِتْر", majorPluralT:"كِيلُومِتْرَاتٍ", minorSingleT:"مِتْر", minorPluralT:"أمْتَارٍ", majorSingleCT:"فِي الثَّانِيَة", majorPluralCT:"فِي الثَّانِيَة", minorSingleCT:"فِي الثَّانِيَة", minorPluralCT:"فِي الثَّانِيَة", symbolNative:"كم/ث", symbolLatin:"كم/ث", secondAs:"qualifier"},
"F10":{majorSingle:"سنة", majorPlural:"سنوات", majorSingleC:"هجرية", majorPluralC:"هجرية", majorSingleT:"سَنَة", majorPluralT:"سَنَوَاتٍ", majorSingleCT:"هِجْرِيَّة", majorPluralCT:"هِجْرِيَّةٍ", majorGender:1}
Editing a unit. src/arqamUnits.js is built by node tools/build_units.js from the page's table js/data.js, which keeps the array positions (the second column above). Change the unit in js/data.js and build again; do not edit src/arqamUnits.js by hand. secondAs is position 21 in js/data.js: "on" there is "qualifier" here and "m" is "idafa"; "off" and empty are the same and are left out.

Option names: Intl and Arqam

Every Arqam option works in the same object (tashkeel, ierab, legal, prefix, brackets…), and the Intl names below too.
When both names of one option are given, Arqam's wins.

The options of toFraction(), toTime() and toDate() go with their style only.
The Intl options that format figures (useGrouping, notation, minimumFractionDigits…) are refused with a RangeError rather than ignored.

Intl nameArqam nameValues
currencycodean ISO code; default: the currency of the locale's country (ar-QA → QAR)
currencyDisplaynumSymbol"code" "symbol" "narrowSymbol" "name" "sign" "native" "english" (symbol and narrowSymbol give the Symbol, $, as Intl does)
numberingSystem, or -u-nu-arabarabicNumbers"arab" "latn"
calendar, or -u-ca-islamiccalendar"gregory" "islamic" "islamic-umalqura", or Arqam's "gregorian" "hijri" "both"
maximumFractionDigits—0–100: the number is rounded to so many places first (styles decimal, percent, currency, unit)
roundingModerounding"halfExpand" (round) or "trunc" (cut)
signDisplay—"auto" "negative" («سالب», the default) or "never"
unit—an Intl name ("kilometer"), a key ("A05") or the Arabic name
unitDisplay—"long" only (the name in words)
—dateFormtoDate's style: "words" "ordinal" "compact"
arqam.NumberFormat({currency: "USD", currency: "SAR"}).format(7)
→سبعة ريالات سعودية
both given: code wins
arqam.NumberFormat("ar-QA-u-nu-arab", {style: "currency", brackets: "end"}).format(1234.5)
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وخمسون درهمًا (١٬٢٣٤٫٥٠ QAR)
Arabic-Eastern numbers and the Arabic separators
arqam.NumberFormat("ar-QA", {style: "currency", maximumFractionDigits: 0}).format(12.75)
→ثلاثة عشر ريالًا قطريًا
arqam.NumberFormat({maximumFractionDigits: 1, roundingMode: "trunc"}).format(3.19)
→ثلاثة، وجزء من العشرة
arqam.NumberFormat({signDisplay: "never"}).format(-7)
→سبعة

The locale

Arqam writes Arabic, so the locale must be "ar" or "ar-XX"; another language is a RangeError, and in a list the first Arabic locale is taken.
The country gives the currency of style "currency"; -u-nu-arab gives Arabic-Eastern numbers and -u-ca-islamic the Hijri calendar.

With no locale, the standing option locale is used, else "ar": arqam.config({locale: "ar-QA"}) once, and every formatter made after it has the riyal.
The standing option does not change toWords().

Arabic-Eastern numbers (-u-nu-arab, numberingSystem: "arab" or arabicNumbers: "on") use the Arabic separators:
Arabic decimal separator (٫ / U+066B): used in formal and typeset Arabic numbers, e.g. ٣٫١
Arabic thousands separator (٬ / U+066C): groups large numbers into thousands, e.g. ١٬٠٠٠٬٠٠٠
arqam.config({locale: "ar-QA"})
arqam.NumberFormat({style: "currency"}).format(5)
→خمسة ريالات قطرية
arqam(5, {style: "currency"})
→خمسة ريالات قطرية
toWords too, as an amount (12.25)
arqam.reset()
JSON.stringify(arqam.NumberFormat.supportedLocalesOf(["ar-QA", "en-GB", "ar"]))
→["ar-QA","ar"]

resolvedOptions(), the standing options, errors

resolvedOptions() gives the locale, the style and the options in force, with the readable names; a formatter made again from it gives the same words.
The standing options of config() are read when the formatter is made: a later config() does not change it, as an Intl formatter never changes.

Mistakes are reported when the formatter is made, not at the first format().

JSON.stringify(arqam.NumberFormat("ar-QA", {style: "currency", tashkeel: "full"}).resolvedOptions())
→{"locale":"ar-QA","style":"currency","roundingMode":"halfExpand","tashkeel":"full","numberingSystem":"latn","currency":"QAR"}
JSON.stringify(arqam.NumberFormat.styles)
→["decimal","percent","currency","unit","ordinal","fraction","time","date","dateTime"]
arqam.NumberFormat("en")
→RangeError: arqam.NumberFormat: Arqam writes Arabic only: use "ar" or "ar-XX" (got "en")
arqam.NumberFormat({style: "currency"})
→TypeError: arqam.NumberFormat: currency is required: give one ({style: "currency", currency: "QAR"}) or a locale with a country ("ar-QA")
arqam.NumberFormat({useGrouping: false})
→RangeError: arqam.NumberFormat: useGrouping is an Intl option for figures; Arqam writes words and does not take it
arqam.NumberFormat({style: "unit", unit: "parsecs"})
→RangeError: arqam.NumberFormat: unknown unit "parsecs" (an Intl name such as "kilometer", an Arqam key such as "A05", or the Arabic name)
arqam.NumberFormat({timeStyle: "exact"})
→TypeError: arqam.NumberFormat: timeStyle belongs to style "time" (this formatter has style "decimal")
TypeScript: ArqamNumberFormatOptions, ArqamNumberFormatInstance and ArqamNumberFormatConstructor are declared in dist/arqamAR.d.mts, and the units add-on in dist/arqamUnits.d.mts: a misspelt style or option is a compile error.

12.22 The parts of the words: formatToParts()

formatToParts(x) gives the words of format(x) cut into labelled pieces, in order.

Each piece is {type, value}.
Joining every value gives exactly the text of format(x).

It works like JavaScript's own Intl.NumberFormat.prototype.formatToParts(), but the pieces are words, not figures.

At a glance

Intl today: figures
new Intl.NumberFormat("ar-EG", {style: "currency", currency: "QAR"}).formatToParts(1250.5)
‏١٬٢٥٠٫٥٠ ر.ق.‏
integergroupdecimalfractioncurrency
Arqam: words
arqam.NumberFormat({style: "currency", currency: "QAR"}).formatToParts(1250.5)
ألف ومائتان وخمسون ريالًا قطريًا، وخمسون درهمًا
integercurrencyfractionminorCurrency

The same type names as Intl are used where Intl has one.
Arqam adds names only for what Intl does not have.

The types of part

TypeWhat it isExample
integerthe number words of the whole part; one part for each group, scale words included (خمسمائة ألف)مليونان
fractionthe number words of the fraction or the minor amountخمسون
currencythe name of the currencyريالًا قطريًا
minorCurrencythe name of the minor unit (Arqam's own: Intl has one currency per amount)درهمًا
unitthe name of the unit (style "unit")كيلوغرامان
minorUnitthe name of the smaller unitغرام
denominatorwhat the fraction counts (Arqam's own)جزءًا من المائة
decimalthe decimal sign in words
percentSignthe percent wordsبالمائة
minusSignthe sign wordسالب
ordinalan ordinal, as one part (Arqam's own)الحادي والعشرون
prefixthe prefix option (Arqam's own)فقط
suffixthe suffix option (Arqam's own)لا غير
figurethe figure in brackets, with its own list of parts in .parts (Arqam's own)(1,250.50 QAR)
daythe day of a dateالخامس عشر
monththe monthنوفمبر
yearthe yearألفين وستة وعشرين
erathe eraللميلاد
hourthe hourالثالثة
minutethe minutes, with their nounخمس عشرة دقيقةً
secondthe seconds, with their nounثلاثون ثانيةً
dayPeriodthe part of the dayعصرًا
literalthe fixed joining text and spaces (، و، من شهر)

Every style, part by part

Each card shows the call, then each part with its type under it.
Open "The list the program gets" to see the list itself.

Currency
NumberFormat({style: "currency", currency: "QAR"}).formatToParts(1250.5)
ألفintegerوliteralمائتان وخمسونintegerريالًا قطريًاcurrency، وliteralخمسونfractionدرهمًاminorCurrency
The list the program gets
[
  {type: "integer", value: "ألف"},
  {type: "literal", value: " و"},
  {type: "integer", value: "مائتان وخمسون"},
  {type: "literal", value: " "},
  {type: "currency", value: "ريالًا قطريًا"},
  {type: "literal", value: "، و"},
  {type: "fraction", value: "خمسون"},
  {type: "literal", value: " "},
  {type: "minorCurrency", value: "درهمًا"}
]
Currency, full tashkeel
NumberFormat({style: "currency", currency: "QAR", tashkeel: "full"}).formatToParts(1250.5)
أَلْفٌintegerوَliteralمِائَتَانِ وَخَمْسُونَintegerرِيَالًا قَطَرِيًّاcurrency، وَliteralخَمْسُونَfractionدِرْهَمًاminorCurrency
The same types in every tashkeel mode.
The list the program gets
[
  {type: "integer", value: "أَلْفٌ"},
  {type: "literal", value: " وَ"},
  {type: "integer", value: "مِائَتَانِ وَخَمْسُونَ"},
  {type: "literal", value: " "},
  {type: "currency", value: "رِيَالًا قَطَرِيًّا"},
  {type: "literal", value: "، وَ"},
  {type: "fraction", value: "خَمْسُونَ"},
  {type: "literal", value: " "},
  {type: "minorCurrency", value: "دِرْهَمًا"}
]
Cheque wording
NumberFormat({style: "currency", currency: "QAR", prefix: "فقط", suffix: "لا غير", brackets: "end"}).formatToParts(1250.5)
فقطprefixألفintegerوliteralمائتان وخمسونintegerريالًا قطريًاcurrency، وliteralخمسونfractionدرهمًاminorCurrencyلا غيرsuffix(1,250.50 QAR)figure
The list the program gets
[
  {type: "prefix", value: "فقط"},
  {type: "literal", value: " "},
  {type: "integer", value: "ألف"},
  {type: "literal", value: " و"},
  {type: "integer", value: "مائتان وخمسون"},
  {type: "literal", value: " "},
  {type: "currency", value: "ريالًا قطريًا"},
  {type: "literal", value: "، و"},
  {type: "fraction", value: "خمسون"},
  {type: "literal", value: " "},
  {type: "minorCurrency", value: "درهمًا"},
  {type: "literal", value: " "},
  {type: "suffix", value: "لا غير"},
  {type: "literal", value: " "},
  {type: "figure", value: "(1,250.50 QAR)", parts: [9 parts]}
]
A negative amount
NumberFormat({style: "currency", currency: "QAR", brackets: "end"}).formatToParts(-7.25)
سالبminusSignسبعةintegerريالات قطريةcurrency، وliteralخمسة وعشرينfractionدرهمًاminorCurrency(-7.25 QAR)figure
The list the program gets
[
  {type: "minusSign", value: "سالب"},
  {type: "literal", value: " "},
  {type: "integer", value: "سبعة"},
  {type: "literal", value: " "},
  {type: "currency", value: "ريالات قطرية"},
  {type: "literal", value: "، و"},
  {type: "fraction", value: "خمسة وعشرين"},
  {type: "literal", value: " "},
  {type: "minorCurrency", value: "درهمًا"},
  {type: "literal", value: " "},
  {type: "figure", value: "(-7.25 QAR)", parts: [8 parts]}
]
Scale words
NumberFormat({style: "currency", currency: "USD"}).formatToParts(2500000)
مليونانintegerوliteralخمسمائة ألفintegerدولار أمريكيcurrency
Scale words stay inside integer: one part for each group.
The list the program gets
[
  {type: "integer", value: "مليونان"},
  {type: "literal", value: " و"},
  {type: "integer", value: "خمسمائة ألف"},
  {type: "literal", value: " "},
  {type: "currency", value: "دولار أمريكي"}
]
Percent
NumberFormat({style: "percent"}).formatToParts(0.125)
ثلاثة عشرintegerبالمائةpercentSign
The list the program gets
[
  {type: "integer", value: "ثلاثة عشر"},
  {type: "literal", value: " "},
  {type: "percentSign", value: "بالمائة"}
]
A fraction in words
NumberFormat().formatToParts(1250.75)
ألفintegerوliteralمائتان وخمسونinteger، وliteralخمسة وسبعونfractionجزءًا من المائةdenominator
The list the program gets
[
  {type: "integer", value: "ألف"},
  {type: "literal", value: " و"},
  {type: "integer", value: "مائتان وخمسون"},
  {type: "literal", value: "، و"},
  {type: "fraction", value: "خمسة وسبعون"},
  {type: "literal", value: " "},
  {type: "denominator", value: "جزءًا من المائة"}
]
Ordinal
NumberFormat({style: "ordinal"}).formatToParts(21)
الحادي والعشرونordinal
The list the program gets
[
  {type: "ordinal", value: "الحادي والعشرون"}
]
Unit (with the units add-on)
NumberFormat({style: "unit", unit: "kilogram"}).formatToParts(2.5)
كيلوغرامانunit، وliteralخمسمائةfractionغرامminorUnit
Arabic puts the dual noun first: the unit comes before its number.
The list the program gets
[
  {type: "unit", value: "كيلوغرامان"},
  {type: "literal", value: "، و"},
  {type: "fraction", value: "خمسمائة"},
  {type: "literal", value: " "},
  {type: "minorUnit", value: "غرام"}
]
Date
NumberFormat({style: "date"}).formatToParts("2026-11-15")
الخامس عشرdayمن شهرliteralنوفمبرmonthلعامliteralألفين وستة وعشرينyearللميلادera
The list the program gets
[
  {type: "day", value: "الخامس عشر"},
  {type: "literal", value: " من شهر "},
  {type: "month", value: "نوفمبر"},
  {type: "literal", value: " لعام "},
  {type: "year", value: "ألفين وستة وعشرين"},
  {type: "literal", value: " "},
  {type: "era", value: "للميلاد"}
]
Date in both calendars
NumberFormat({style: "date", calendar: "both", dateForm: "compact"}).formatToParts("2026-11-21")
21dayنوفمبرmonth2026yearمera، الموافقliteral11dayجمادى الآخرةmonth1448yearهـera
The list the program gets
[
  {type: "day", value: "21"},
  {type: "literal", value: " "},
  {type: "month", value: "نوفمبر"},
  {type: "literal", value: " "},
  {type: "year", value: "2026"},
  {type: "era", value: "م"},
  {type: "literal", value: "، الموافق "},
  {type: "day", value: "11"},
  {type: "literal", value: " "},
  {type: "month", value: "جمادى الآخرة"},
  {type: "literal", value: " "},
  {type: "year", value: "1448"},
  {type: "era", value: "هـ"}
]
Time
NumberFormat({style: "time"}).formatToParts("15:15")
الساعةliteralالثالثةhourوliteralخمس عشرة دقيقةًminuteعصرًاdayPeriod
The list the program gets
[
  {type: "literal", value: "الساعة "},
  {type: "hour", value: "الثالثة"},
  {type: "literal", value: " و"},
  {type: "minute", value: "خمس عشرة دقيقةً"},
  {type: "literal", value: " "},
  {type: "dayPeriod", value: "عصرًا"}
]
Time with the parts of the hour
NumberFormat({style: "time", timeParts: true}).formatToParts("9:45")
الساعةliteralالعاشرةhourإلاliteralالربعminuteصباحًاdayPeriod
The list the program gets
[
  {type: "literal", value: "الساعة "},
  {type: "hour", value: "العاشرة"},
  {type: "literal", value: " إلا "},
  {type: "minute", value: "الربع"},
  {type: "literal", value: " "},
  {type: "dayPeriod", value: "صباحًا"}
]
Fraction
NumberFormat({style: "fraction"}).formatToParts("2 3/4")
اثنانintegerوliteralثلاثة أرباعfraction
The list the program gets
[
  {type: "integer", value: "اثنان"},
  {type: "literal", value: " و"},
  {type: "fraction", value: "ثلاثة أرباع"}
]

The figure in brackets

The figure is one part of type figure, so the list of words stays simple.

A program that wants the digits reads figure.parts: the figure cut as Intl cuts figures.

Arabic-Western numbers
(literal-minusSign1integer,group250integer.decimal50fractionQARcurrency)literal
Arabic-Eastern numbers and the Arabic separators ٬ ٫
(literal١integer٬group٢٥٠integer٫decimal٥٠fractionر.ق.currency)literal

What a program can do with the parts

All four examples come from one call.
No searching inside the text is needed, so they work in every tashkeel mode and with every option.

const parts = arqam.NumberFormat({style: "currency", currency: "QAR",
  prefix: "فقط", suffix: "لا غير", brackets: "end"}).formatToParts(1250.5);
A · A cheque: the words on the line, the figure in the box
ادفعوا بموجب هذا الشيك مبلغفقط ألف ومائتان وخمسون ريالًا قطريًا، وخمسون درهمًا لا غير
المبلغ1,250.50 QARالتوقيع ____________
const words  = parts.filter(p => p.type !== "figure").map(p => p.value).join("").trim();
const figure = parts.find(p => p.type === "figure").value;
B · Colour styles: one CSS rule for each type
فقط ألف ومائتان وخمسون ريالًا قطريًا، وخمسون درهمًا لا غير
Numbers and units
فقط ألف ومائتان وخمسون ريالًا قطريًا، وخمسون درهمًا لا غير
Quiet units
فقط ألف ومائتان وخمسون ريالًا قطريًا، وخمسون درهمًا لا غير
Highlight the amount
.t-integer, .t-fraction { color: #1f5fbf; font-weight: 700 }
.t-currency, .t-minorCurrency { color: #0f7b4c }
C · HTML for a web page or a screen reader
const html = parts.map(p => p.type === "literal" ? p.value
  : `<span class="t-${p.type}">${p.value}</span>`).join("");
<span class="t-prefix">فقط</span>
<span class="t-integer">ألف</span>
و
<span class="t-integer">مائتان وخمسون</span>
<span class="t-currency">ريالًا قطريًا</span>
، و
<span class="t-fraction">خمسون</span>
<span class="t-minorCurrency">درهمًا</span>
<span class="t-suffix">لا غير</span>
<span class="t-figure">(1,250.50 QAR)</span>
D · Take one part: the minor amount
const minor = parts.filter(p => p.type === "fraction" || p.type === "minorCurrency")
                   .map(p => p.value).join(" ");
خمسون درهمًا

The calls

arqam.NumberFormat({style: "currency", currency: "QAR"}).formatToParts(1250.5).map(p => p.type).join(" ")
→"integer literal integer literal currency literal fraction literal minorCurrency"
arqam.NumberFormat({style: "currency", currency: "QAR"}).formatToParts(1250.5).map(p => p.value).join("")
→ألف ومائتان وخمسون ريالًا قطريًا، وخمسون درهمًا
the parts joined: format()
arqam.NumberFormat({style: "percent"}).formatToParts(0.125).find(p => p.type === "percentSign").value
→بالمائة
JSON.stringify(arqam.NumberFormat({style: "currency", currency: "QAR", brackets: "end"}).formatToParts(7).pop().parts.map(p => p.type))
→["literal","integer","decimal","fraction","literal","currency","literal"]
JSON.stringify(arqam.NumberFormat({style: "ordinal"}).formatToParts([1, 2]))
→[[{"type":"ordinal","value":"الأول"}],[{"type":"ordinal","value":"الثاني"}]]
a list gives the parts of each value
JSON.stringify(arqam.NumberFormat().formatToParts("x"))
→[]
a value that cannot be written: no parts
Good to know
format(), toWords(), toParts() and the split colour marks are unchanged; formatToParts() is only added to the formatter.
Like format, formatToParts is bound: list.map(nf.formatToParts) works.
The minute and second parts keep their noun (خمس عشرة دقيقة), because in Arabic the noun can carry the number itself (دقيقة، دقيقتان): every minute part has the same shape, whatever the number.
TypeScript: ArqamPart, ArqamPartType and ArqamFigurePart are declared in dist/arqamAR.d.mts.

12.23 Ranges: formatRange() and formatRangeToParts()

formatRange(start, end) writes two values as one range: «من … إلى …».

It works like JavaScript's own Intl.NumberFormat.prototype.formatRange().

Intl puts a dash between two figures.
Arabic words need «من» and «إلى», and both values then take the genitive case.

At a glance

Intl: figures with a dash
new Intl.NumberFormat("ar-EG", {style: "currency", currency: "QAR"}).formatRange(1000, 2000)
‏١٬٠٠٠٫٠٠–٢٬٠٠٠٫٠٠ ر.ق.‏
Arqam: words, «من … إلى …»
arqam.NumberFormat({style: "currency", currency: "QAR"}).formatRange(1000, 2000)
من ألف ريال قطري إلى ألفي ريال قطري
the start valueمن / إلىthe end valueunderline: the type of each part, as in 12.22

Why not join two format() calls?

Because a value after «من» or «إلى» is in the genitive, and the genitive changes the words.

Joining two format() calls by hand keeps the nominative.
The words in red are wrong; formatRange() gives the words in green.

ValuesTwo format() calls joined by handformatRange()
QAR 1000 → 2000من ألف ريال قطري إلى ألفا ريال قطريمن ألف ريال قطري إلى ألفي ريال قطري
QAR 1 → 2من ريال قطري إلى ريالان قطريانمن ريال قطري إلى ريالين قطريين
SYP 11 → 20من إحدى عشرة ليرةً سوريةً إلى عشرون ليرةً سوريةًمن إحدى عشرة ليرةً سوريةً إلى عشرين ليرةً سوريةً
KWD 30 → 250من ثلاثون دينارًا كويتيًا إلى مائتان وخمسون دينارًا كويتيًامن ثلاثين دينارًا كويتيًا إلى مائتين وخمسين دينارًا كويتيًا

For beginners: six ranges to start with

Make a formatter once, then call formatRange() with the smaller value first.

The style is the same as for format(): a currency, a plain number, a percentage, a unit, a date or a time.

const f = arqam.NumberFormat({style: "currency", currency: "QAR"});
f.formatRange(1000, 2000);   // من ألف ريال قطري إلى ألفي ريال قطري
1 · A price range
NumberFormat({style: "currency", currency: "QAR"}).formatRange(1000, 2000)
من ألف ريال قطري إلى ألفي ريال قطري
The currency is written with both values, so each one reads on its own.
2 · Plain numbers
NumberFormat().formatRange(5, 10)
من خمسة إلى عشرة
3 · Percentages
NumberFormat({style: "percent"}).formatRange(0.05, 0.1)
من خمسة بالمائة إلى عشرة بالمائة
As with format(), 0.05 is 5%.
4 · Units
NumberFormat({style: "unit", unit: "kilometer"}).formatRange(3, 5)
من ثلاثة كيلومترات إلى خمسة كيلومترات
Style "unit" needs the units add-on (arqamUnits.js).
5 · Dates in one month
NumberFormat({style: "date"}).formatRange("2026-11-01", "2026-11-15")
من الأول إلى الخامس عشر من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد
The month and the year are written once.
6 · Working hours
NumberFormat({style: "time"}).formatRange("9:00", "17:30")
من الساعة التاسعة صباحًا إلى الساعة الخامسة وثلاثين دقيقةً عصرًا

The rules, with examples

Both values in the genitive
ألفا ← ألفي، ريالان قطريان اثنان ← ريالين قطريين اثنين، عشرون ← عشرين
من ريال قطري إلى ريالين قطريين
من الأول إلى الحادي والعشرين
Equal values: one value
No «من … إلى …» when both ends are the same (also after rounding).
خمسة ريالات قطرية
formatRange(5, 5) → format(5)
The start after the end: an error
As in Intl. Put the smaller value first.
formatRange(2000, 1000)
RangeError: arqam.NumberFormat: the start of a range must not be after its end (got 2000 and 1000)
Prefix and suffix once, round the whole range
فقط من ألف ريال قطري إلى ألفي ريال قطري لا غير
One figure for the range
With brackets "end" or "start" the figure shows both values with a dash.
من ألف ريال قطري إلى ألفي ريال قطري (1,000.00–2,000.00 QAR)
من ألف ريال قطري إلى ألفي ريال قطري (١٬٠٠٠٫٠٠–٢٬٠٠٠٫٠٠ QAR)
Dates share what they can
One month: the month once. One year: the year once. Two years: two full dates. From «غرة»: the month stays with it, and the end day takes «منه».
من الأول إلى الخامس عشر من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد
من غرة شهر نوفمبر إلى الخامس عشر منه لعام ألفين وستة وعشرين للميلاد
من الأول من شهر نوفمبر إلى الحادي والعشرين من شهر ديسمبر لعام ألفين وستة وعشرين للميلاد
من العشرين من شهر ديسمبر لعام ألفين وستة وعشرين للميلاد إلى الخامس من شهر يناير لعام ألفين وسبعة وعشرين للميلاد

For advanced users

formatRangeToParts(start, end) gives the parts of the range, as formatToParts() does for one value.

Each part also has source: "startRange", "endRange" or "shared", as in Intl.

The list the program gets
[
  {type: "literal", value: "من ", source: "shared"},
  {type: "integer", value: "ألف", source: "startRange"},
  {type: "literal", value: " ", source: "startRange"},
  {type: "currency", value: "ريال قطري", source: "startRange"},
  {type: "literal", value: " إلى ", source: "shared"},
  {type: "integer", value: "ألفي", source: "endRange"},
  {type: "literal", value: " ", source: "endRange"},
  {type: "currency", value: "ريال قطري", source: "endRange"}
]
Each part: its type above, its source below
literalمنsharedintegerألفstartRangecurrencyريال قطريstartRangeliteralإلىsharedintegerألفيendRangecurrencyريال قطريendRange

Recipes

A · Colour by source
const html = parts.map(p => p.source === "shared" ? p.value
  : `<span class="${p.source}">${p.value}</span>`).join("");
من ألف ريال قطري إلى ألفي ريال قطري
B · Take the two amounts apart
const start = parts.filter(p => p.source === "startRange").map(p => p.value).join("").trim();
const end   = parts.filter(p => p.source === "endRange").map(p => p.value).join("").trim();
ألف ريال قطري · ألفي ريال قطري
C · A contract clause, full tashkeel
const f = arqam.NumberFormat({style: "currency", currency: "QAR", tashkeel: "full"});
"تتراوح قيمة العقد " + f.formatRange(250000, 1000000)
تتراوح قيمة العقد مِنْ مِائَتَيْنِ وَخَمْسِينَ أَلْفَ رِيَالٍ قَطَرِيٍّ إِلَى مِلْيُونِ رِيَالٍ قَطَرِيٍّ
D · A table of price bands
const f = arqam.NumberFormat({style: "currency", currency: "QAR"});
bands.map(([a, b]) => f.formatRange(a, b));
من صفر ريال قطري إلى خمسمائة ريال قطري
من خمسمائة ريال قطري إلى ألفي ريال قطري
من ألفي ريال قطري إلى عشرة آلاف ريال قطري

More styles and options

Ordinals
NumberFormat({style: "ordinal", tashkeel: "full"}).formatRange(1, 21)
مِنَ الْأَوَّلِ إِلَى الْحَادِي وَالْعِشْرِينَ
«مِنَ» before الـ, as Arabic writes it.
Durations
NumberFormat({style: "time", timeStyle: "duration"}).formatRange("1:30", "2:45")
من ساعة ونصف إلى ساعتين وثلاثة أرباع
The parts of the hour
NumberFormat({style: "time", timeParts: true}).formatRange("9:15", "17:30")
من الساعة التاسعة والربع صباحًا إلى الساعة الخامسة والنصف عصرًا
Fractions
NumberFormat({style: "fraction"}).formatRange("1/2", "2 3/4")
من نصف إلى اثنين وثلاثة أرباع
Compact dates
NumberFormat({style: "date", dateForm: "compact"}).formatRange("2026-11-01", "2026-11-15")
من 1 إلى 15 نوفمبر 2026م
A cheque or a tender
NumberFormat({style: "currency", currency: "QAR", prefix: "فقط", suffix: "لا غير", brackets: "end"}).formatRange(1250.5, 2500)
فقط من ألف ومائتين وخمسين ريالًا قطريًا، وخمسين درهمًا إلى ألفين وخمسمائة ريال قطري لا غير (1,250.50–2,500.00 QAR)

The calls

arqam.NumberFormat({style: "currency", currency: "QAR"}).formatRange(1000, 2000)
→من ألف ريال قطري إلى ألفي ريال قطري
arqam.NumberFormat({style: "currency", currency: "QAR", tashkeel: "full"}).formatRange(1, 2)
→مِنْ رِيَالٍ قَطَرِيٍّ إِلَى رِيَالَيْنِ قَطَرِيَّيْنِ
arqam.NumberFormat({style: "currency", currency: "QAR"}).formatRange(5, 5)
→خمسة ريالات قطرية
equal values: one value
arqam.NumberFormat({style: "currency", currency: "QAR"}).formatRange(2000, 1000)
→RangeError: arqam.NumberFormat: the start of a range must not be after its end (got 2000 and 1000)
the start after the end
arqam.NumberFormat().formatRange(5)
→TypeError: arqam.NumberFormat: formatRange needs a start and an end, e.g. formatRange(1000, 2000)
both values are needed
arqam.NumberFormat().formatRange("x", 5)
→""
a value that cannot be written: the isNaN value ("")
arqam.NumberFormat({style: "currency", currency: "QAR"}).formatRangeToParts(1, 2).map(p => p.source).join(" ")
→"shared startRange shared endRange"
JSON.stringify(arqam.NumberFormat({style: "currency", currency: "QAR", brackets: "end"}).formatRangeToParts(1, 2).pop().parts.map(p => p.value))
→["(","1",".","00","–","2",".","00"," ","QAR",")"]
the figure's own parts; the dash is literal
Good to know
The methods toWords(), toDate(), toTime() and toFraction() are unchanged: the genitive is used only inside a range.
Like format, formatRange and formatRangeToParts are bound to their formatter.
With strict: "on", a value that cannot be written throws its error, as format() does.
With two calendars (calendar: "both") each date is written in full, with «الموافق».
TypeScript: formatRange, formatRangeToParts and ArqamRangePart are declared in dist/arqamAR.d.mts.

12.24 Approximate quantities: approx

At a glance

Three options, all off by default: approx (the kind), approxWord (the word of "about") and approxRound (round first).
They work in toWords(), toParts(), config() and arqam.NumberFormat, on the page in the group «الكمية التقريبية» (5.13), and in the playground.

Questions and answers: 12, «Approximate quantities».

arqam("1000", {currency: "MAD", approx: "about"})
→قرابة ألف درهم مغربي
arqam("1000000", {currency: "MAD", approx: "over"})
→ما يزيد على مليون درهم مغربي
arqam("5000", {currency: "QAR", approx: "few"})
→بضعة آلاف ريال قطري
arqam("23", {currency: "QAR", approx: "plus"})
→نيف وعشرون ريالًا قطريًا

The four families and their grammar

When the exact figure is not the point, approx writes the number approximately, in four families, each with its own grammar.
Off by default: without it every word is as before.

The figure in brackets stays with A and B; C and D take whole numbers and leave it out, because an exact figure beside «بضعة» would contradict it.

FamilyThe ruleapproxExample (engine, full tashkeel)
A. A leading wordقرابة، نحو، زهاء take the case of their place and are مضاف; حوالَيْ is a ظرف; the number after them is مضاف إليه مجرور, then the counted noun follows its usual rule"about"قُرَابَةَ أَلْفِ رِيَالٍ سُعُودِيٍّ
قُرَابَةُ أَلْفَي رِيَالٍ سُعُودِيٍّ
نَحْوَ عِشْرِينَ رِيَالًا سُعُودِيًّا
B. A phrase ending in a prepositionthe phrase is fixed (أقلّ takes the case of its place, a diptote); the number after على، من، عن is اسم مجرور; «مِنِ/عَنِ» before a hamzat al-wasl"over" "under" "atLeast" "atMost"مَا يَزِيدُ عَلَى مِلْيُونِ دِرْهَمٍ إِمَارَاتِيٍّ
أَقَلُّ مِنِ اثْنَي عَشَرَ دِرْهَمًا إِمَارَاتِيًّا
مَا لَا يَقِلُّ عَنْ أَلْفَي دِرْهَمٍ إِمَارَاتِيٍّ
C. بضع (3–9)treated as the numbers 3–9: the opposite gender of the counted noun, a compound with عشر, joined to the tens; 300–900: «بضع مئات من …»"few"بِضْعَةُ دُولَارَاتٍ أَمْرِيكِيَّةٍ
بِضْعَةَ عَشَرَ دُولَارًا أَمْرِيكِيًّا
بِضْعَةٌ وَعِشْرُونَ دُولَارًا أَمْرِيكِيًّا
بِضْعَةُ آلَافِ دُولَارٍ أَمْرِيكِيٍّ
بِضْعُ لِيرَاتٍ تُرْكِيَّةٍ
بِضْعُ مِئَاتٍ مِنَ الدُّولَارَاتِ الْأَمْرِيكِيَّةِ
D. نيّف (1–9)in the place of the units before the tens, in their case, the same for both genders; after a round hundred or thousand: «… ونيّف» at the end"plus"نَيِّفٌ وَعِشْرُونَ جُنَيْهًا مِصْرِيًّا
نَيِّفًا وَعِشْرِينَ جُنَيْهًا مِصْرِيًّا
مِائَةٌ وَنَيِّفٌ وَعِشْرُونَ جُنَيْهًا مِصْرِيًّا
مِائَةُ جُنَيْهٍ مِصْرِيٍّ وَنَيِّفٌ
arqam("1000", {currency: "MAD", approx: "about"})
→قرابة ألف درهم مغربي
arqam("1000", {currency: "MAD", approx: "about", approxWord: "zuhaa"})
→زهاء ألف درهم مغربي
arqam("1250.5", {currency: "QAR", approx: "about", brackets: "end"})
→قرابة ألف ومائتين وخمسين ريالًا قطريًا، وخمسين درهمًا (1,250.50 QAR)
arqam("987450", {currency: "QAR", approx: "about", approxRound: 1})
→قرابة مليون ريال قطري
arqam("5000", {currency: "QAR", approx: "few"})
→بضعة آلاف ريال قطري
arqam("23000", {currency: "QAR", approx: "plus"})
→نيف وعشرون ألف ريال قطري
arqam("150", {approx: "few"})
→""
«بضع» does not fit 150: the isNaN value (""), or with strict "on" a RangeError that says why
arqam.NumberFormat({currency: "QAR", approx: "about"}).formatToParts(1000).map(p => p.type + ": " + p.value).join(" | ")
→approx: قرابة | literal: | integer: ألف | literal: | currency: ريال قطري
the part type approx

«اشرح» explains the approximate words too (arqam.explain()), and words back to numbers reads them: «قرابة ألف ريال» gives 1000 with approx: "about"; «بضعة آلاف» and «نيّف وعشرون» have no single value, so they give value: null with min and max (3000–9000, 21–29).

arqam.explain("1000", {currency: "QAR", approx: "about", ierab: "nasb"}).words.slice(0, 2).map(w => w.word + ": " + w.short).join(" · ")
→قرابة: منصوب وعلامة نصبه الفتحة الظاهرة، وهو مضاف · ألف: مضاف إليه مجرور بالكسرة الظاهرة، وهو مضاف
JSON.stringify(arqam.findNumbers("دفعت قرابة ألف ريال ثم بضعة آلاف").map(x => [x.approx, x.value, x.min, x.max]))
→[["about","1000",null,null],["few",null,"3000","9000"]]

Every value

approxWordsTakesExample
"about"قرابة · نحو · زهاء · حوالَيْany number of zero or more, decimals and %1000: قرابة ألف ريال سعودي
"over"ما يزيد علىthe same1000: ما يزيد على ألف درهم إماراتي
"under"أقلّ منthe same1000: أقل من ألف دولار أمريكي
"atLeast"ما لا يقل عنthe same1000: ما لا يقل عن ألف جنيه مصري
"atMost"ما لا يزيد علىthe same1000: ما لا يزيد على ألف درهم مغربي
"few"بضع / بضعةwhole numbers 3–9, 13–19, 23–99 (not ending in 0–2), times a thousand, a million …; 300–9005000: بضعة آلاف ريال قطري
"plus"نيّفwhole numbers 21–99 not ending in 0, and a round hundred, thousand … with 1–9 more125: مائة ونيف وعشرون ريالًا سعوديًا

A negative number or an ordinal cannot be approximate.
A number a value cannot take gives the isNaN value, or with strict: "on" a RangeError that names the numbers that fit.

12.25 Regions and time zones: locale, timeZone, zoneName

At a glance

One option, locale, gives a whole region at once: its currency, its month names, its digits (Arabic-Western or Arabic-Eastern numbers), its separators and its time zone, for every method: toWords(), toParts(), toDate(), toTime(), the new toDateTime() and NumberFormat.
Two more options handle the clock: timeZone moves an exact moment into a zone, and zoneName says how the zone is named: «بتوقيت الدوحة».

With no locale and no timeZone nothing of this applies.

arqam.config({locale: "ar-QA"})
arqam("1500", {style: "currency"})
→ألف وخمسمائة ريال قطري
an amount: the currency of the region
arqam.toDate("2026-11-24")
→الرابع والعشرون من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد
Gulf month names
arqam.toTime("2026-11-24T06:15:00Z")
→الساعة التاسعة وخمس عشرة دقيقةً صباحًا بتوقيت الدوحة
an exact moment: Doha time, named by its city
arqam.toTime("21:01")
→الساعة التاسعة ودقيقة مساءً
a plain time: no zone
arqam.toDateTime("2026-11-23T19:30:00Z")
→الثالث والعشرون من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد، الساعة العاشرة وثلاثون دقيقةً مساءً بتوقيت الدوحة
the date, the time and the zone
arqam.reset()

Where the zones come from

Zone names such as "Europe/London" come from the IANA Time Zone Database, the public list kept by IANA and used by Windows, macOS, Linux, Android, iPhone and every browser.
Arqam does not carry it: JavaScript already has it, with every clock rule past and future (summer time in Egypt, Lebanon and Palestine; Morocco's change in Ramadan).

When a country changes its clocks, the browser's update brings the change.
Arqam carries only the Arabic names below.

The names are "Region/City", usually the largest city in the zone, not always the capital: the United Arab Emirates is Asia/Dubai and Morocco Africa/Casablanca; Qatar is Asia/Qatar (there is no "Asia/Doha").
Intl.supportedValuesOf("timeZone") lists them, and Intl.DateTimeFormat().resolvedOptions().timeZone gives the zone of the computer.

InputNo locale, no timeZoneWith a locale or a timeZone
A plain date or time: "2026-11-24", "21:01"as typedthe region's month names; never a zone
ISO with a time and no zone: "2026-11-24T06:15"as typed (toDate: the date part)as typed, never moved, never named
An exact moment: ISO with Z or an offset, or a Dateas written (a Date: the computer's clock); named only when zoneName is givenmoved into the zone (the day too, Hijri included) and named by its city

The 22 Arab locales

What each locale gives.
The offsets are those of 15 January and 15 July 2026, from the time-zone rules of the computer that built this manual.

arqam.regions gives the same table to a program.

LocaleCountryTime zone
offset Jan / Jul
CurrencyMonth namesDigits and separatorszoneName: "city" (default)zoneName: "country"
ar-QAQatarAsia/Qatar
+3 / +3
QARGulf & EgyptArabic-Western
1,234.5
بتوقيت الدوحة
بِتَوْقِيتِ الدَّوْحَةِ
بتوقيت قطر
بِتَوْقِيتِ قَطَرَ
ar-BHBahrainAsia/Bahrain
+3 / +3
BHDGulf & EgyptArabic-Western
1,234.5
بتوقيت المنامة
بِتَوْقِيتِ الْمَنَامَةِ
بتوقيت البحرين
بِتَوْقِيتِ الْبَحْرَيْنِ
ar-KWKuwaitAsia/Kuwait
+3 / +3
KWDGulf & EgyptArabic-Western
1,234.5
بتوقيت الكويت
بِتَوْقِيتِ الْكُوَيْتِ
بتوقيت الكويت
بِتَوْقِيتِ الْكُوَيْتِ
ar-AEUnited Arab EmiratesAsia/Dubai
+4 / +4
AEDGulf & EgyptArabic-Western
1,234.5
بتوقيت أبوظبي
بِتَوْقِيتِ أَبُوظَبْي
بتوقيت الإمارات
بِتَوْقِيتِ الْإِمَارَاتِ
ar-OMOmanAsia/Muscat
+4 / +4
OMRGulf & EgyptArabic-Western
1,234.5
بتوقيت مسقط
بِتَوْقِيتِ مَسْقَطَ
بتوقيت عُمان
بِتَوْقِيتِ عُمَانَ
ar-SASaudi ArabiaAsia/Riyadh
+3 / +3
SARGulf & EgyptArabic-Eastern
١٬٢٣٤٫٥
بتوقيت مكة المكرمة
بِتَوْقِيتِ مَكَّةَ الْمُكَرَّمَةِ
بتوقيت السعودية
بِتَوْقِيتِ السُّعُودِيَّةِ
ar-YEYemenAsia/Aden
+3 / +3
YERGulf & EgyptArabic-Eastern
١٬٢٣٤٫٥
بتوقيت صنعاء
بِتَوْقِيتِ صَنْعَاءَ
بتوقيت اليمن
بِتَوْقِيتِ الْيَمَنِ
ar-IQIraqAsia/Baghdad
+3 / +3
IQDLevant & IraqArabic-Eastern
١٬٢٣٤٫٥
بتوقيت بغداد
بِتَوْقِيتِ بَغْدَادَ
بتوقيت العراق
بِتَوْقِيتِ الْعِرَاقِ
ar-SYSyriaAsia/Damascus
+3 / +3
SYPLevant & IraqArabic-Eastern
١٬٢٣٤٫٥
بتوقيت دمشق
بِتَوْقِيتِ دِمَشْقَ
بتوقيت سوريا
بِتَوْقِيتِ سُورِيَا
ar-LBLebanonAsia/Beirut
+2 / +3 (summer time)
LBPLevant & IraqArabic-Western
1,234.5
بتوقيت بيروت
بِتَوْقِيتِ بَيْرُوتَ
بتوقيت لبنان
بِتَوْقِيتِ لُبْنَانَ
ar-JOJordanAsia/Amman
+3 / +3
JODLevant & IraqArabic-Eastern
١٬٢٣٤٫٥
بتوقيت عمّان
بِتَوْقِيتِ عَمَّانَ
بتوقيت الأردن
بِتَوْقِيتِ الْأُرْدُنِّ
ar-PSPalestineAsia/Hebron
+2 / +3 (summer time)
ILSLevant & IraqArabic-Eastern
١٬٢٣٤٫٥
بتوقيت القدس
بِتَوْقِيتِ الْقُدْسِ
بتوقيت فلسطين
بِتَوْقِيتِ فِلَسْطِينَ
ar-EGEgyptAfrica/Cairo
+2 / +3 (summer time)
EGPGulf & EgyptArabic-Eastern
١٬٢٣٤٫٥
بتوقيت القاهرة
بِتَوْقِيتِ الْقَاهِرَةِ
بتوقيت مصر
بِتَوْقِيتِ مِصْرَ
ar-SDSudanAfrica/Khartoum
+2 / +2
SDGGulf & EgyptArabic-Eastern
١٬٢٣٤٫٥
بتوقيت الخرطوم
بِتَوْقِيتِ الْخُرْطُومِ
بتوقيت السودان
بِتَوْقِيتِ السُّودَانِ
ar-LYLibyaAfrica/Tripoli
+2 / +2
LYDGulf & EgyptArabic-Western
1.234,5
بتوقيت طرابلس
بِتَوْقِيتِ طَرَابُلُسَ
بتوقيت ليبيا
بِتَوْقِيتِ لِيبِيَا
ar-TNTunisiaAfrica/Tunis
+1 / +1
TNDNorth AfricaArabic-Western
1.234,5
بتوقيت تونس
بِتَوْقِيتِ تُونِسَ
بتوقيت تونس
بِتَوْقِيتِ تُونِسَ
ar-DZAlgeriaAfrica/Algiers
+1 / +1
DZDNorth AfricaArabic-Western
1.234,5
بتوقيت الجزائر
بِتَوْقِيتِ الْجَزَائِرِ
بتوقيت الجزائر
بِتَوْقِيتِ الْجَزَائِرِ
ar-MAMoroccoAfrica/Casablanca
+1 / +1
MADMoroccoArabic-Western
1.234,5
بتوقيت الرباط
بِتَوْقِيتِ الرِّبَاطِ
بتوقيت المغرب
بِتَوْقِيتِ الْمَغْرِبِ
ar-MRMauritaniaAfrica/Nouakchott
0 / 0
MRUNorth AfricaArabic-Western
1,234.5
بتوقيت نواكشوط
بِتَوْقِيتِ نُوَاكْشُوطَ
بتوقيت موريتانيا
بِتَوْقِيتِ مُورِيتَانْيَا
ar-SOSomaliaAfrica/Mogadishu
+3 / +3
SOSGulf & EgyptArabic-Western
1,234.5
بتوقيت مقديشو
بِتَوْقِيتِ مُقَدِيشُو
بتوقيت الصومال
بِتَوْقِيتِ الصُّومَالِ
ar-DJDjiboutiAfrica/Djibouti
+3 / +3
DJFGulf & EgyptArabic-Western
1,234.5
بتوقيت جيبوتي
بِتَوْقِيتِ جِيبُوتِي
بتوقيت جيبوتي
بِتَوْقِيتِ جِيبُوتِي
ar-KMComorosIndian/Comoro
+3 / +3
KMFGulf & EgyptArabic-Western
1,234.5
بتوقيت موروني
بِتَوْقِيتِ مُورُونِي
بتوقيت جزر القمر
بِتَوْقِيتِ جُزُرِ الْقَمَرِ
Notes. Qatar and Bahrain use Arabic-Western numbers in Arqam (the browsers use Arabic-Eastern), on purpose. Libya, Tunisia, Algeria and Morocco write 1.234,5, as their browsers do. Morocco also moves to GMT (+0) during Ramadan. Palestine's second zone, Asia/Gaza, has the same names. A country in a locale outside the table ("ar-US") keeps only its currency in NumberFormat; a region that is no country ("ar-XX") is a RangeError.

World airline hubs

Thirty-five (35) zones outside the Arab world are named too.
A country with several zones (the United States, Canada, Brazil, Russia, Australia, Indonesia) has no country name: the city is written in both modes, because «بتوقيت الولايات المتحدة» would not say which clock.

Any other zone is named by its offset, e.g. «بتوقيت غرينتش −7», unless you give it a name with registerTimeZone().
arqam.timeZones lists every named zone.

Time zoneOffset Jan / Jul"city""country"
Europe/London0 / +1 (summer time)بتوقيت لندن
بِتَوْقِيتِ لَنْدَنَ
بتوقيت المملكة المتحدة
بِتَوْقِيتِ الْمَمْلَكَةِ الْمُتَّحِدَةِ
Europe/Paris+1 / +2 (summer time)بتوقيت باريس
بِتَوْقِيتِ بَارِيسَ
بتوقيت فرنسا
بِتَوْقِيتِ فَرَنْسَا
Europe/Berlin+1 / +2 (summer time)بتوقيت برلين
بِتَوْقِيتِ بَرْلِينَ
بتوقيت ألمانيا
بِتَوْقِيتِ أَلْمَانْيَا
Europe/Amsterdam+1 / +2 (summer time)بتوقيت أمستردام
بِتَوْقِيتِ أَمْسْتِرْدَامَ
بتوقيت هولندا
بِتَوْقِيتِ هُولَنْدَا
Europe/Madrid+1 / +2 (summer time)بتوقيت مدريد
بِتَوْقِيتِ مَدْرِيدَ
بتوقيت إسبانيا
بِتَوْقِيتِ إِسْبَانْيَا
Europe/Rome+1 / +2 (summer time)بتوقيت روما
بِتَوْقِيتِ رُومَا
بتوقيت إيطاليا
بِتَوْقِيتِ إِيطَالْيَا
Europe/Zurich+1 / +2 (summer time)بتوقيت زيورخ
بِتَوْقِيتِ زِيُورِخَ
بتوقيت سويسرا
بِتَوْقِيتِ سُوِيسْرَا
Europe/Istanbul+3 / +3بتوقيت إسطنبول
بِتَوْقِيتِ إِسْطَنْبُولَ
بتوقيت تركيا
بِتَوْقِيتِ تُرْكِيَا
Europe/Moscow+3 / +3بتوقيت موسكو
بِتَوْقِيتِ مُوسْكُو
the city (several zones)
America/New_York−5 / −4 (summer time)بتوقيت نيويورك
بِتَوْقِيتِ نِيُويُورْكَ
the city (several zones)
America/Chicago−6 / −5 (summer time)بتوقيت شيكاغو
بِتَوْقِيتِ شِيكَاغُو
the city (several zones)
America/Los_Angeles−8 / −7 (summer time)بتوقيت لوس أنجلوس
بِتَوْقِيتِ لُوس أَنْجِلُوسَ
the city (several zones)
America/Toronto−5 / −4 (summer time)بتوقيت تورونتو
بِتَوْقِيتِ تُورُونْتُو
the city (several zones)
America/Sao_Paulo−3 / −3بتوقيت ساو باولو
بِتَوْقِيتِ سَاو بَاوْلُو
the city (several zones)
Africa/Johannesburg+2 / +2بتوقيت جوهانسبرغ
بِتَوْقِيتِ جُوهَانِسْبِرْغَ
بتوقيت جنوب أفريقيا
بِتَوْقِيتِ جَنُوبِ أَفْرِيقْيَا
Africa/Nairobi+3 / +3بتوقيت نيروبي
بِتَوْقِيتِ نَيْرُوبِي
بتوقيت كينيا
بِتَوْقِيتِ كِينْيَا
Africa/Lagos+1 / +1بتوقيت لاغوس
بِتَوْقِيتِ لَاغُوسَ
بتوقيت نيجيريا
بِتَوْقِيتِ نَيْجِيرْيَا
Asia/Tehran+3:30 / +3:30بتوقيت طهران
بِتَوْقِيتِ طِهْرَانَ
بتوقيت إيران
بِتَوْقِيتِ إِيرَانَ
Asia/Karachi+5 / +5بتوقيت كراتشي
بِتَوْقِيتِ كَرَاتْشِي
بتوقيت باكستان
بِتَوْقِيتِ بَاكِسْتَانَ
Asia/Kolkata+5:30 / +5:30بتوقيت نيودلهي
بِتَوْقِيتِ نِيُودِلْهِي
بتوقيت الهند
بِتَوْقِيتِ الْهِنْدِ
Asia/Dhaka+6 / +6بتوقيت دكا
بِتَوْقِيتِ دَكَّا
بتوقيت بنغلاديش
بِتَوْقِيتِ بَنْغْلَادِيشَ
Asia/Kathmandu+5:45 / +5:45بتوقيت كاتماندو
بِتَوْقِيتِ كَاتْمَانْدُو
بتوقيت نيبال
بِتَوْقِيتِ نِيبَالَ
Asia/Colombo+5:30 / +5:30بتوقيت كولومبو
بِتَوْقِيتِ كُولُومْبُو
بتوقيت سريلانكا
بِتَوْقِيتِ سْرِيلَانْكَا
Asia/Bangkok+7 / +7بتوقيت بانكوك
بِتَوْقِيتِ بَانْكُوكَ
بتوقيت تايلاند
بِتَوْقِيتِ تَايْلَانْدَ
Asia/Singapore+8 / +8بتوقيت سنغافورة
بِتَوْقِيتِ سِنْغَافُورَةَ
بتوقيت سنغافورة
بِتَوْقِيتِ سِنْغَافُورَةَ
Asia/Kuala_Lumpur+8 / +8بتوقيت كوالالمبور
بِتَوْقِيتِ كُوَالَالَمْبُورَ
بتوقيت ماليزيا
بِتَوْقِيتِ مَالِيزْيَا
Asia/Jakarta+7 / +7بتوقيت جاكرتا
بِتَوْقِيتِ جَاكَرْتَا
the city (several zones)
Asia/Manila+8 / +8بتوقيت مانيلا
بِتَوْقِيتِ مَانِيلَا
بتوقيت الفلبين
بِتَوْقِيتِ الْفِلِبِّينِ
Asia/Hong_Kong+8 / +8بتوقيت هونغ كونغ
بِتَوْقِيتِ هُونْغ كُونْغ
بتوقيت هونغ كونغ
بِتَوْقِيتِ هُونْغ كُونْغ
Asia/Shanghai+8 / +8بتوقيت بكين
بِتَوْقِيتِ بِكِينَ
بتوقيت الصين
بِتَوْقِيتِ الصِّينِ
Asia/Tokyo+9 / +9بتوقيت طوكيو
بِتَوْقِيتِ طُوكْيُو
بتوقيت اليابان
بِتَوْقِيتِ الْيَابَانِ
Asia/Seoul+9 / +9بتوقيت سيول
بِتَوْقِيتِ سِيُولَ
بتوقيت كوريا الجنوبية
بِتَوْقِيتِ كُورِيَا الْجَنُوبِيَّةِ
Australia/Sydney+11 / +10 (summer time)بتوقيت سيدني
بِتَوْقِيتِ سِيدْنِي
the city (several zones)
Pacific/Auckland+13 / +12 (summer time)بتوقيت أوكلاند
بِتَوْقِيتِ أُوكْلَانْدَ
بتوقيت نيوزيلندا
بِتَوْقِيتِ نِيُوزِيلَنْدَا
UTC0 / 0بتوقيت غرينتش
بِتَوْقِيتِ غْرِينِتْشَ
بتوقيت غرينتش
بِتَوْقِيتِ غْرِينِتْشَ

Options and functions

NameValuesDefaultWhat it does
locale"ar-QA" … "ar-KM"""the region's defaults: currency (toWords with no code), month names, digits, separators, time zone. Reaches toWords, toParts, toDate, toTime, toDateTime and NumberFormat (as its first argument or in its options). -u-nu-arab / -u-nu-latn in the tag choose the digits.
timeZone"asWritten" "local" "Asia/Qatar" …""the clock of an exact moment: "" = the locale's zone, else as written; "asWritten" keeps the time as typed even with a locale; "local" is the computer's zone; an IANA name (any letter case). An unknown name is a RangeError with "did you mean".
zoneName"city" "country" "offset" "both" "off"""how the zone is named after the time: "" = the city when a zone is shown. As written (no locale, no timeZone) a zone is named only when zoneName is given, by its offset.
toDateTime(x, options)ISO with a time, or a Date; an array gives an arraythe date, «، », the time and the zone; takes the options of toDate and of toTime (not timeStyle "duration")
registerTimeZone(zone, name)an IANA name; Arabic text, or nullyour own name for a zone, or instead of the built-in one, in every mode; written as given in every tashkeel mode; null takes it away; shared by every instance
arqam.regionsthe 22 locales and what each gives (the table above)
arqam.timeZonesevery named zone: the 22, the 35 hubs and your own
NumberFormat style "dateTime"the ninth style: format(), formatToParts() (part type timeZone), formatRange()

What overrides what

OrderSourceExample
1an option in the calltoWords("5", {currency: "MAD"})
2an option in config() or the instance, given with the locale or after itconfig({locale: "ar-KW", arabicNumbers: "off"})
3the locale's defaultsconfig({locale: "ar-MA"}) → MAD, Morocco month names, 1.500,50, Africa/Casablanca
4Arqam's defaultsno currency, Gulf month names, Arabic-Western numbers, the time as written

A locale sets the digits when it is given (in config() or in the call); an arabicNumbers given in the same call or later wins.
In toWords and NumberFormat the locale gives its currency to an amount, style: "currency", as in Intl; a number stays a number, and a currency in the call wins.

An ordinal never takes the currency.

Examples

arqam("1500.5", {locale: "ar-JO", style: "currency", brackets: "end"})
→ألف وخمسمائة دينار أردني، وخمسمائة فلس (١٬٥٠٠٫٥٠٠ JOD)
Arabic-Eastern numbers and separators
arqam("1500.5", {locale: "ar-KW", style: "currency", brackets: "end"})
→ألف وخمسمائة دينار كويتي، وخمسمائة فلس (1,500.500 KWD)
Arabic-Western numbers
arqam("1500.5", {locale: "ar-MA", style: "currency", brackets: "end"})
→ألف وخمسمائة درهم مغربي، وخمسون سنتيمًا (1.500,50 MAD)
the Maghreb separators
arqam.toDate("2026-11-24", {locale: "ar-IQ"})
→الرابع والعشرون من شهر تشرين الثاني لعام ألفين وستة وعشرين للميلاد
arqam.toDate("2026-07-20", {locale: "ar-MA"})
→العشرون من شهر يوليوز لعام ألفين وستة وعشرين للميلاد
arqam("99.5", {locale: "ar-QA", currency: "MAD"})
→تسعة وتسعون درهمًا مغربيًا، وخمسون سنتيمًا
a code in the call wins
arqam.toTime("2026-11-24T06:15:00Z", {locale: "ar-SA"})
→الساعة التاسعة وخمس عشرة دقيقةً صباحًا بتوقيت مكة المكرمة
zoneName "city" (default)
arqam.toTime("2026-11-24T06:15:00Z", {locale: "ar-SA", zoneName: "country"})
→الساعة التاسعة وخمس عشرة دقيقةً صباحًا بتوقيت السعودية
arqam.toTime("2026-11-24T06:15:00Z", {locale: "ar-SA", zoneName: "offset"})
→الساعة التاسعة وخمس عشرة دقيقةً صباحًا بتوقيت غرينتش ؜+٣
arqam.toTime("2026-11-24T06:15:00Z", {locale: "ar-SA", zoneName: "both"})
→الساعة التاسعة وخمس عشرة دقيقةً صباحًا بتوقيت مكة المكرمة (غرينتش ؜+٣)
arqam.toTime("2026-11-24T06:15:00Z", {locale: "ar-SA", zoneName: "both", tashkeel: "full"})
→السَّاعَةُ التَّاسِعَةُ وَخَمْسَ عَشْرَةَ دَقِيقَةً صَبَاحًا بِتَوْقِيتِ مَكَّةَ الْمُكَرَّمَةِ (غْرِينِتْشَ ؜+٣)
arqam.toTime("2026-11-24T14:30:00Z", {locale: "ar-EG"})
→الساعة الرابعة وثلاثون دقيقةً عصرًا بتوقيت القاهرة
a server stores UTC; the user sees Cairo time
arqam.toDateTime("2026-11-23T19:30:00Z", {timeZone: "Asia/Qatar"})
→الثالث والعشرون من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد، الساعة العاشرة وثلاثون دقيقةً مساءً بتوقيت الدوحة
a flight leaves Doha …
arqam.toDateTime("2026-11-24T01:30:00Z", {timeZone: "Europe/London"})
→الرابع والعشرون من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد، الساعة الواحدة وثلاثون دقيقةً ليلًا بتوقيت لندن
… and lands in London: a hub
["ar-QA", "ar-EG", "ar-AE"].map(l => arqam.toTime("2026-11-24T06:15:00Z", {locale: l}))
→الساعة التاسعة وخمس عشرة دقيقةً صباحًا بتوقيت الدوحةالساعة الثامنة وخمس عشرة دقيقةً صباحًا بتوقيت القاهرةالساعة العاشرة وخمس عشرة دقيقةً صباحًا بتوقيت أبوظبي
one meeting, three offices
arqam.toTime("2026-01-15T12:00:00Z", {locale: "ar-EG", zoneName: "both"})
→الساعة الثانية ظهرًا بتوقيت القاهرة (غرينتش ؜+٢)
Cairo in winter
arqam.toTime("2026-07-15T12:00:00Z", {locale: "ar-EG", zoneName: "both"})
→الساعة الثالثة عصرًا بتوقيت القاهرة (غرينتش ؜+٣)
Cairo in summer: the browser's rules
arqam.toTime("2026-03-01T12:00:00Z", {locale: "ar-MA", zoneName: "both"})
→الساعة الثانية عشرة ظهرًا بتوقيت الرباط (غرينتش)
Morocco in Ramadan (1 March 2026)
arqam.toTime("2026-11-24T06:15:00Z", {timeZone: "Asia/Kolkata", zoneName: "both"})
→الساعة الحادية عشرة وخمس وأربعون دقيقةً صباحًا بتوقيت نيودلهي (غرينتش ‎+5:30)
+5:30
arqam.toTime("2026-11-24T06:15:00Z", {timeZone: "Asia/Kathmandu", zoneName: "both"})
→الساعة الثانية عشرة ظهرًا بتوقيت كاتماندو (غرينتش ‎+5:45)
+5:45
arqam.toDate("2026-11-23T22:30:00Z", {calendar: "both", locale: "ar-QA"})
→الرابع والعشرون من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد، الموافق الرابع عشر من شهر جمادى الآخرة لعام ألف وأربعمائة وثمانية وأربعين للهجرة
Doha: 01:30 the next day; the Hijri day moves too
arqam.toTime("2026-11-23T22:30:00+03:00")
→الساعة العاشرة وثلاثون دقيقةً مساءً
no locale, no timeZone: as written
arqam.toTime("2026-11-23T22:30:00+03:00", {zoneName: "offset"})
→الساعة العاشرة وثلاثون دقيقةً مساءً بتوقيت غرينتش ‎+3
arqam.toDate("20261124T061500Z")
→الرابع والعشرون من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد
the compact ISO form
arqam.toTime("2026-11-24T06:15:00Z", {timeZone: "America/Denver"})
→الساعة الحادية عشرة وخمس عشرة دقيقةً مساءً بتوقيت غرينتش ‎−7
a zone with no name: its offset
arqam.toTime("2026-11-24T06:15:00Z", {timeZone: "America/Denver"})
→الساعة الحادية عشرة وخمس عشرة دقيقةً مساءً بتوقيت دنفر
after registerTimeZone("America/Denver", "دنفر")
arqam.NumberFormat("ar-QA", {style: "dateTime"}).formatToParts("2026-11-24T06:15:00Z").slice(-3).map(p => p.type + ": " + p.value).join(" | ")
→dayPeriod: صباحًا | literal: | timeZone: بتوقيت الدوحة
the part type timeZone
arqam.NumberFormat("ar-QA", {style: "dateTime"}).formatRange("2026-11-24T06:15:00Z", "2026-11-24T08:00:00Z")
→من الرابع والعشرين من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد، الساعة التاسعة وخمس عشرة دقيقةً صباحًا بتوقيت الدوحة إلى الرابع والعشرين من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد، الساعة الحادية عشرة صباحًا بتوقيت الدوحة
arqam.explain.time("2026-11-24T06:15:00Z", {locale: "ar-SA"}).words.slice(-3).map(w => w.word + ": " + w.short).join(" · ")
→بتوقيت: الباء حرف جر مبني على الكسر، و«توقيت» اسم مجرور بالباء وعلامة جره الكسرة الظاهرة، وهو مضاف · مكة: مضاف إليه مجرور وعلامة جره الفتحة نيابة عن الكسرة لأنه ممنوع من الصرف · المكرمة: نعت لـ«مكة» مجرور مثله وعلامة جره الكسرة الظاهرة
«اشرح» explains the zone words
arqam.toTime("2026-11-24T06:15:00Z", {timeZone: "Asia/Doha", strict: "on"})
→RangeError: arqamAR: unknown time zone "Asia/Doha" (did you mean "Asia/Qatar"?)
arqam.config({locale: "ar-XX"})
→RangeError: arqamAR: unknown locale "ar-XX"; Arqam knows the 22 Arab League locales (ar-QA, ar-SA, ar-EG, …) and "ar" with any country

The direction mark

The offset carries an invisible direction mark before its sign, as CLDR writes signed numbers in Arabic: LRM (U+200E) with Arabic-Western numbers, so «غرينتش +3» and «غرينتش −7» keep the sign before the digits inside Arabic text and never show as "3+"; ALM (U+061C) with Arabic-Eastern numbers, read right to left as «غرينتش +٣».
The mark takes no space and is copied with the text.

To compare text, remove it with s.replace(/[\u200E\u061C]/g, "").

[...arqam.toTime("2026-11-24T06:15:00Z", {timeZone: "America/Denver", zoneName: "offset"})].slice(-4).map(c => "U+" + c.codePointAt(0).toString(16).toUpperCase().padStart(4, "0")).join(" ")
→"U+0020 U+200E U+2212 U+0037"
LRM before the minus sign
[...arqam.toTime("2026-11-24T06:15:00Z", {timeZone: "Asia/Kuwait", zoneName: "offset", arabicNumbers: "on"})].slice(-3).map(c => "U+" + c.codePointAt(0).toString(16).toUpperCase().padStart(4, "0")).join(" ")
→"U+061C U+002B U+0663"
ALM with Arabic-Eastern numbers

What a locale changes

Only calls with a locale or a time zone change; every other call is unchanged.
With config({locale}): toWords() writes the region's currency for an amount (style: "currency", as in Intl; a number stays a number); NumberFormat("ar-KW") and the other locales with Arabic-Eastern numbers now write them in the figure in brackets (give -u-nu-latn or arabicNumbers: "off" for the old figures); a region that is no country ("ar-XX") is now a RangeError.

ISO text with a time is now read by toTime() too.

12.26 Building blocks: arqam.utils

The pieces the engine is made of, for your own programs: count any noun with the right grammar, write a number or an ordinal alone, read a date, a time or a fraction the way Arqam reads it, turn a Gregorian day into a Hijri one and back, put number words in another case, and make Arabic text comparable.
Each one that writes words takes the toWords options (tashkeel, ierab, …).

A mistake throws a TypeError or RangeError named arqam.utils.<name>.
In a module: import {utils} from "arqam".

Words

arqam.utils.count(3, {single: "كتاب", plural: "كتب"})
→ثلاثة كتب
any noun: no need to register it
arqam.utils.count(11, {single: "سيارة", plural: "سيارات", gender: "feminine"})
→إحدى عشرة سيارةً
a feminine noun
arqam.utils.count(2, {single: "كتاب", plural: "كتب"})
→كتابان
1 and 2: the noun alone (keepOne: true keeps اثنان)
arqam.utils.count(25, { single: "طالب", plural: "طلاب", singleT: "طَالِب", pluralT: "طُلَّابٍ", tashkeel: "full", ierab: "jarr" })
→خَمْسَةٍ وَعِشْرِينَ طَالِبًا
full tashkeel: give the vowelled forms (the plural in the genitive)
arqam.utils.cardinal(13, {gender: "feminine"})
→ثلاث عشرة
the number alone, feminine
arqam.utils.ordinal(21, {gender: "feminine", definite: false})
→حادية وعشرون
an ordinal without الـ
arqam.utils.percent(25)
→خمسة وعشرون بالمائة
arqam.utils.scaleName(3, {plural: true})
→مليارات
the scale word of 10^9
arqam.utils.toCase("السادسُ والعشرونَ من شهرِ نوفمبرَ", "jarr")
→السادسِ والعشرينَ من شهرِ نوفمبرَ
after في: the head words take the genitive

Reading and calendars

JSON.stringify(arqam.utils.parseDate("26/11/2026"))
→{"year":2026,"month":11,"day":26,"hijri":{"year":1448,"month":6,"day":16},"date":"2026-11-26T12:00:00.000Z"}
the day, its Hijri day and a Date (UTC noon)
JSON.stringify(arqam.utils.parseDate("1 رمضان 1447", {input: "h"}))
→{"year":2026,"month":2,"day":18,"hijri":{"year":1447,"month":9,"day":1},"date":"2026-02-18T12:00:00.000Z"}
a Hijri date
JSON.stringify(arqam.utils.parseTime("3:15 م"))
→{"hour":15,"minute":15,"second":0}
JSON.stringify(arqam.utils.parseFraction("3½"))
→{"whole":"3","numerator":1,"denominator":2}
JSON.stringify(arqam.utils.hijri("2026-11-26"))
→{"year":1448,"month":6,"day":16}
JSON.stringify(arqam.utils.fromHijri(1447, 9, 1))
→{"year":2026,"month":2,"day":18,"date":"2026-02-18T12:00:00.000Z"}
1 Ramadan 1447
(() => { try { arqam.utils.parseDate("30/02/2026"); } catch (e) { return e.message; } })()
→"arqam.utils.parseDate: \"30/02/2026\" does not exist"
why it cannot be read

Text

arqam.utils.normalize("أَلْفٌ وَمِائَةُ مُؤَسَّسَة")
→الف ومايه موسسه
for search and comparison
arqam.utils.digits("١٢٣٫٥")
→123٫5
arqam.utils.digits("2026", "eastern")
→٢٠٢٦
arqam.utils.suggest("tashkel", Object.keys(arqam.defaults))
→"tashkeel"
did you mean

Every option, from one table

arqam.utils.options lists every option once, with its default, kind, values and readable names, and what toDate, toTime, toFraction and toDateTime take.
The engine's checkers read the same table, so the list is always the one the engine enforces.

arqam.utils.options.calls.toDate.own.join(", ")
→"calendar, input, style, months, year, era, order, gora, ierab"
JSON.stringify(arqam.utils.options.options.ierab)
→{"default":"r","kind":"choice","values":["r","n","j",""],"names":{"raf":"r","nasb":"n","jarr":"j"}}

12.27 Good to know

13. Questions and answers (FAQ)

579 questions about the library, from first steps to advanced use, in 29 sections.
Every answer with code shows the engine's own result for that call, so the words you see are exactly what you will get.

Click a question to open it; search or filter by level below.

13.1 First steps (30)

What Arqam is, how to load it and how to make the first call.

Q1What is Arqam?Beginner

Arqam (أرقام, "numbers") is a JavaScript library that writes numbers and amounts in correct Arabic words (تفقيط): the gender of 3–10 against the counted noun, the dual, the case endings, the scale words, the fractions and the currency names.
It also writes ordinals, percentages, dates (Gregorian and Hijri), times and typed fractions, and reads Arabic number words back into figures.

It has no dependencies and needs no network.

arqam("1250.50", {currency: "EGP"})
→ألف ومائتان وخمسون جنيهًا مصريًا، وخمسون قرشًا
#Q1
Q2Which file do I load in a web page?Beginner

For a plain page, load the engine script; it creates one global object, arqamAR.
For a modern build or a type="module" script, import dist/arqamAR.mjs instead (see the next questions).

<script src="arqamAR.js"></script>
<script>
  document.getElementById("amount").textContent = arqam("1250.50", {currency: "MAD"});
</script>
#Q2
Q3How do I import it as an ES module?Beginner

dist/arqamAR.mjs has a default export (the whole library) and named exports for every method, so you can import only what you use.

import arqam from "./dist/arqamAR.mjs";          // the whole library
import {toWords, toDate} from "./dist/arqamAR.mjs"; // or only some methods
toWords("25", {currency: "USD"});     // خمسة وعشرون دولارا أمريكيا
#Q3
Q4How do I install it from npm?Beginner

The package name is arqam.
It is ES-module only (Node 14.13 or later, or any bundler).

Sub-paths give the other parts: arqam/words (words back to numbers), arqam/explain (grammar), arqam/en (English words) and /min for each minified file.

npm install arqam
import arqam from "arqam";
import arqamWordsToNumbers from "arqam/words";
import arqamExplain from "arqam/explain";
#Q4
Q5How do I use it in Node.js with require()?Beginner

The library is published as an ES module.
In CommonJS code use a dynamic import(); it works in every Node version the package supports.

// CommonJS file
(async () => {
  const {default: arqam} = await import("arqam");
  console.log(arqam("2500", {currency: "KWD"}));
})();
#Q5
Q6Is it arqam or arqamAR?Beginner

arqam is the library; arqamAR is its Arabic engine.
Arabic is the default and the calls are the engine's, but arqam.toWords and arqam.NumberFormat have Intl's shape: arqam(n, locales, options) gives the words of new arqam.NumberFormat(locales, options).format(n), with Intl's option names and rounding.

Write arqam in new code; code that uses arqamAR keeps working, and import arqamAR from "arqam" still gives every Arabic call.
(The manual writes its examples with arqam.)

Object.getPrototypeOf(arqam) === arqamAR
→true
arqam("1250.50", "ar-QA", {style: "currency"}) === arqam("1250.50", {currency: "QAR"})
→true
#Q6
Q7Why are the engines called arqamAR and arqamEN?Beginner

Each language is an engine of its own, named arqam with the language's two-letter ISO 639-1 code in capitals: arqamAR (Arabic), arqamEN (English), and later arqamFR, arqamDE and so on.
Each works on its own, and the library reaches them as arqam.ar, arqam.en … A new language is one more module; the library does not change.

#Q7
Q8How do I get English words through arqam?Intermediate

Load the English engine (arqam/en as a module, or arqamEN.js as a plain script) and give an English locale, as in Intl: arqam(n, "en-GB", options) or new arqam.NumberFormat("en-GB", options).
It finds the library however the two were loaded, in any order.

Before it is loaded an English locale is a RangeError that says so.

import arqam from "arqam";
import "arqam/en";
arqam.NumberFormat.supportedLocalesOf(["ar", "en"]);   // ["ar", "en"]
arqam("1250.50", "en-US", {currency: "QAR"});   // One Thousand Two Hundred Fifty Qatari Riyals and Fifty Dirhams
#Q8
Q9Does loading English add a global name?Advanced

No. A language engine puts itself in one shared table keyed by Symbol.for("arqam.languages"); a symbol key is not a global name, so nothing on the page can clash with it.
As plain scripts, arqamAR.js gives the two names arqam and arqamAR, and arqamEN.js the name arqamEN.

#Q9
Q10How do I write an amount in Arabic and English, as on a bilingual cheque?Beginner

Load the English engine and call arqam.toBilingual(number, code).
It gives the Arabic with «فقط … لا غير», the English with "Only" (in UK style: "Two Hundred and Fifty"), and the figure.

only: "off" leaves out «فقط … لا غير» and "Only"; style: "us" leaves out the "and".

arqam.toBilingual("1250.50", "QAR").ar
→فقط ألف ومائتان وخمسون ريالًا قطريًا، وخمسون درهمًا لا غير
arqam.toBilingual("1250.50", "QAR").en
→"One Thousand Two Hundred and Fifty Qatari Riyals and Fifty Dirhams Only"
#Q10
Q11Can Arqam write the line of a cheque, an invoice, a receipt or a contract?Beginner

Yes: arqam.toClause(kind, number, code, options) with "cheque", "invoice", "receipt" or "contract", and the payee, what it is for, the number and the date as options.
It gives the text, its lines, the words and the figure.

lang: "en" writes it in English, lang: ["ar", "en"] in both.
A contract article has no «فقط … لا غير», since the amount sits inside a sentence.

The wording is Arqam's own; it does not claim to follow any bank's or regulator's form.

arqam.toClause("cheque", "2500", "KWD", {payee: "مؤسسة النور"}).lines[1]
→مبلغًا وقدره: فقط ألفان وخمسمائة دينار كويتي لا غير (2,500.000 KWD)
arqam.toClause("cheque", "2500", "KWD", {payee: "Al Noor Est.", lang: "en"}).lines[1]
→"The sum of: Two Thousand Five Hundred Kuwaiti Dinars Only (KWD 2,500.000)"
#Q11
Q12verify() says the words are wrong: how do I see what is wrong?Intermediate

verify() gives issue: "whole" when the whole units differ, "subunit" when only the fraction does, "both", "currency", "none" or "several"; difference, the words minus the figure; and expectedWords, the figure in words, to compare with.

wordsToNumbers.verify("ألف ومائتان وخمسون ريالا قطريا، وخمسون درهما", "1250.75", {currency: "QAR"}).issue
→"subunit"
wordsToNumbers.verify("ألف ومائتان وخمسون ريالا قطريا، وخمسون درهما", "1250.75", {currency: "QAR"}).difference
→"-0.25"
#Q12
Q13Why does UK English give "Fifteen Thousand Four Hundred" with no "and"?Intermediate

In British usage "and" goes only before the tens and units: "One Thousand Two Hundred and Fifty", "One Thousand and Five", but "Fifteen Thousand Four Hundred". arqamEN 1.12 and earlier wrote "Fifteen Thousand and Four Hundred"; 1.13 follows the British rule.
US style has no "and" at all.

arqam("15400", "en-GB")
→"Fifteen Thousand Four Hundred"
arqam("1250", "en-GB")
→"One Thousand Two Hundred and Fifty"
#Q13
Q14Intl.NumberFormat already names currencies, in Arabic too: why does Arqam keep its own names?Intermediate

Intl (CLDR) gives a name to put beside a figure, not the words of an amount.
For 149 of the 160 currencies it shares with Arqam it writes the same Arabic after 1, 2, 3, 11 and 100 («2.00 ريال قطري»), with no dual, no plural, no accusative and no gender, so it cannot say «ريالان قطريان», «ثلاثة ريالات» or «ثلاث ليرات».

It has no subunits (dirham, fils, halala), no case or tashkeel, and nothing for 28 of Arqam's currencies (the cryptocurrencies, the Guernsey pound …).
Its names change with the browser's version, and some are wrong (it calls the Lebanese lira «جنيه لبناني»).

Arqam uses it as a check instead: node tools/check_cldr.js prints every difference, and it found the faults that arqamEN 1.14 fixed.

#Q14
Q15What is the simplest call?Beginner

toWords(number) with the number as text.
With no options you get plain numbers, no tashkeel, in the nominative case.

arqam("2026")
→ألفان وستة وعشرون
arqam("1000000")
→مليون
#Q15
Q16How do I write an amount of money?Beginner

Pass the ISO 4217 currency code as the second parameter, or as code in an options object.
The engine writes the major and minor units with their correct number agreement.

arqam("1234.56", {currency: "QAR"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا
arqam("1234.56", {currency: "SAR"})
→ألف ومائتان وأربعة وثلاثون ريالًا سعوديًا، وست وخمسون هللةً
#Q16
Q17What is the difference between the second parameter as text and as an object?Beginner

Text is a shortcut for a currency code only.
An object can hold any options.

Both apply to this one call only.

arqam("5", {currency: "USD"})
→خمسة دولارات أمريكية
arqam("5", {currency: "USD", tashkeel: "full"})
→خَمْسَةُ دُولَارَاتٍ أَمْرِيكِيَّةٍ
#Q17
Q18Which version am I using?Beginner

arqam.version gives the engine version.
The releases are listed in CHANGELOG.md.

arqam.version
→"1.85"
#Q18
Q19Does it need the internet or send any data anywhere?Beginner

No. Everything runs in your page or process; there are no requests, no tracking and no external fonts in the library.
You can copy the files to a machine with no network.

#Q19
Q20Which browsers are supported?Beginner

Any current browser: Chrome, Edge, Firefox and Safari on computers and phones.
The engine uses BigInt for very long numbers, which every current browser has.

#Q20
Q21Is there TypeScript support?Beginner

Yes. dist/arqamAR.d.mts (and the declarations for the reader and explain) describe every method, option and value.
Editors pick them up automatically, so a misspelt option or a wrong value is shown as you type.

import arqam, {type ArqamOptions} from "arqam";
const opts: ArqamOptions = {currency: "SAR", tashkeel: "full"};
arqam("12.5", opts);
#Q21
Q22Is there a minified file?Intermediate

No. The library ships readable ES modules only (dist/*.mjs): you can read and step through them, and your bundler or server can minify and compress them with the rest of your code.

#Q22
Q23How do I load it from a CDN safely?Intermediate

Pin a version and use the Subresource Integrity hash from dist/SRI.txt, so the browser refuses a file that was changed.

<script type="module" integrity="sha384-…" crossorigin="anonymous">
  import arqam from "https://cdn.example.com/arqam/2.0.0/arqamAR.mjs";
</script>
#Q23
Q24Can I use it in React, Vue, Angular or Svelte?Intermediate

Yes; it is plain JavaScript with no dependencies.
Import it and call it where you render.

Show the words in an element with dir="rtl".

import {toWords} from "arqam";
export function Amount({value, code}) {
  return <span dir="rtl" lang="ar">{toWords(value, code)}</span>;
}
#Q24
Q25Is Arqam free to use in commercial products?Beginner

Yes: it is under the MIT licence (see LICENSE).
Keep the licence notice with the files.

#Q25
Q26Do I need to load anything else, such as fonts or data files?Beginner

No. The engine contains all its data (currencies, scale names, months).
Fonts are your page's choice; any Arabic font works.

#Q26
Q27Can I use it with Deno or Bun?Intermediate

Yes, both run ES modules.

// Deno
import arqam from "npm:arqam";
// Bun
import arqam from "arqam";
console.log(arqam("12", {currency: "QAR"}));
#Q27
Q28Can I use it in an Electron or Cordova app?Intermediate

Yes: it has no network or DOM needs, so it works in any JavaScript runtime.

#Q28
Q29How do I load the reader and explain as well?Intermediate

Load them after the engine; each attaches its methods to arqamAR.

<script src="arqamAR.js"></script>
<script src="arqamWordsToNumbers.js"></script>   <!-- adds fromWords, findNumbers, verify -->
<script src="arqamExplain.js"></script>          <!-- adds explain -->
#Q29
Q30How do I use it from Python, PHP or another language?Advanced

Run it in Node.js and call it from your language, for example as a small HTTP service (see "Performance and integration") or a command-line script.

// words.mjs:  node words.mjs 1250.5 QAR
import {toWords} from "arqam";
console.log(toWords(process.argv[2], process.argv[3] || ""));
# Python
import subprocess
words = subprocess.check_output(["node", "words.mjs", "1250.5", "SAR"], text=True).strip()
#Q30

13.2 The number you pass (25)

Which inputs are accepted, which are refused, and why text is safer than a JavaScript number.

Q31Should I pass the number as text or as a number?Beginner

As text, whenever you can.
A JavaScript number keeps only about 16 significant digits and some decimals cannot be stored exactly, so the words would describe the stored value, not the one you typed.

Text is read digit by digit.

arqam("12345678901234567890")
→اثنا عشر كوينتليونًا وثلاثمائة وخمسة وأربعون كوادرليونًا وستمائة وثمانية وسبعون تريليونًا وتسعمائة مليار ومليار ومائتان وأربعة وثلاثون مليونًا وخمسمائة وسبعة وستون ألفًا وثمانمائة وتسعون
text: every digit
arqam(12345678901234567890)
→اثنا عشر كوينتليونًا وثلاثمائة وخمسة وأربعون كوادرليونًا وستمائة وثمانية وسبعون تريليونًا وتسعمائة مليار ومليار ومائتان وأربعة وثلاثون مليونًا وخمسمائة وسبعة وستون ألفًا
a JS number: the last digits are lost
#Q31
Q32What does 0.1 + 0.2 give?Beginner

In JavaScript 0.1 + 0.2 is 0.30000000000000004.
toWords rounds as Intl does (3 places for a number), so it gives «ثلاثة أجزاء من العشرة»; with maximumFractionDigits large enough you see the long number.

For money, keep the amount as text from the start.

arqam(0.1 + 0.2)
→ثلاثة أجزاء من العشرة
arqam(0.1 + 0.2, {maximumFractionDigits: 20})
→ثلاثون كوادرليونًا وأربعة أجزاء من المائة كوادرليون
#Q32
Q33Which number formats are accepted?Beginner

Arabic-Western digits with an optional decimal point, an optional - before and an optional % after; Arabic-Eastern digits ٠–٩ the same way; a JavaScript number; or a BigInt.

arqam("1234.5")
→ألف ومائتان وأربعة وثلاثون، وخمسة أجزاء من العشرة
arqam("٣٤٥")
→ثلاثمائة وخمسة وأربعون
arqam(-7)
→سالب سبعة
arqam(10n ** 21n)
→سكستليون
#Q33
Q34Can I pass 1,234 with a thousands separator?Beginner

No. The engine expects a canonical number; "1,234" could mean one thousand two hundred and thirty-four or one point two three four, depending on the country.
Remove the separators before the call (see "How do I clean what the user typed?").

arqam("1,234")
→""
arqam("1,234".replace(/,/g, ""))
→ألف ومائتان وأربعة وثلاثون
#Q34
Q35What happens with spaces around the number?Beginner

The text must be the number only.
Trim it first.

arqam(" 5 ")
→""
arqam(" 5 ".trim())
→خمسة
#Q35
Q36Is scientific notation (1e5) accepted?Beginner

Not as text: "1e5" is refused.
A JavaScript number written that way is fine, because it is just a number.

arqam("1e5")
→""
arqam(1e5)
→مائة ألف
#Q36
Q37What about a plus sign?Beginner

"+5" is refused as text; pass "5".

arqam("+5")
→""
arqam("5")
→خمسة
#Q37
Q38Are leading and trailing zeros a problem?Beginner

No. Leading zeros of the whole part are ignored; trailing zeros of the fraction do not change the value.
A trailing point is fine too, and a number may start with the point.

arqam("007")
→سبعة
arqam("5.")
→خمسة
arqam(".5")
→خمسة أجزاء من العشرة
arqam("2.50", {currency: "AED"})
→درهمان إماراتيان، وخمسون فلسًا
#Q38
Q39What do I get for an empty string or text that is not a number?Beginner

The value of the isNaN option, which is an empty string by default.
Use strict: "on" if you want an error that says why (see the "Errors" section).

arqam("")
→""
arqam("abc")
→""
arqam("abc", {isNaN: "غير صالح"})
→غير صالح
#Q39
Q40What do null, undefined, true and NaN give?Intermediate

None of them is a number, so each gives the isNaN value ("" by default), or a TypeError with strict.
This includes a missing number (undefined, or no argument at all), which gave «صفر» before.

Zero must be passed as 0 or "0".

arqam(null)
→""
arqam(undefined)
→""
arqam(true)
→""
arqam(NaN)
→""
arqam(undefined, {strict: "on"})
→TypeError: arqam.toWords: no number was given
arqam(0)
→صفر
#Q40
Q41Are Persian digits accepted?Intermediate

No; only the Arabic-Eastern digits ٠١٢٣٤٥٦٧٨٩ (U+0660–U+0669) and the Arabic-Western digits.
Persian digits ۰–۹ (U+06F0–U+06F9) must be converted first.

arqam("۳۴۵")
→ثلاثمائة وخمسة وأربعون
arqam("۳۴۵".replace(/[۰-۹]/g, d => "۰۱۲۳۴۵۶۷۸۹".indexOf(d)))
→ثلاثمائة وخمسة وأربعون
#Q41
Q42How do I clean what the user typed?Intermediate

Turn the user's text into the canonical form: remove spaces and thousands separators, turn the Arabic decimal separator «٫» and comma into a point as your users expect, then pass the result.

function canonical(t) {
  return String(t).trim()
    .replace(/[\s,٬']/g, "")      // spaces and thousands separators
    .replace(/[٫]/g, ".");         // the Arabic decimal separator
}
arqam(canonical(" ١٬٢٣٤٫٥ "), {currency: "USD"});
#Q42
Q43What is the largest number Arqam can write?Beginner

There is no largest number.
The whole part may have any number of digits, in every scale (Arabic, short and long): the scale names have no end, and the engine builds its tables as far as the number needs.

After the 999th -illion come ملينيليون (10^3003), مليمليون (10^3006) and so on.
No option is needed.

Pass very long numbers as text (a JavaScript number keeps about 16 digits) or as a BigInt.

arqam("1" + "0".repeat(3003))
→ملينيليون
10^3003: 3,004 digits
arqam("1" + "0".repeat(6000), {scale: "long"})
→ملينيليون
6,001 digits, long scale
arqam("9".repeat(10000)).length
→161640
10,000 digits: the length of the words
arqam(10n ** 40n)
→عشرة ديوديسيليونات
a BigInt
#Q43
Q44What is the largest number of decimal places?Beginner

There is no limit.
toWords rounds as Intl does, to 3 places for a number; give maximumFractionDigits (any whole number in Arqam, where Intl stops at 100) to keep more, or roundingMode: "trunc" to cut instead of rounding.

decRound cuts at its number of places and turns the rounding off.
With a currency the decimals are its minor unit: the currency's own places (QAR 2, KWD 3, JPY 0, BTC 8), and extra digits are cut unless rounding is on.

arqam("0." + "0".repeat(4000) + "5", {maximumFractionDigits: 4001})
→خمسة أجزاء من المائة مليديوتريجنتاتريسنتليون
4,001 decimal places
arqam("3.14159265358979323846", {maximumFractionDigits: 20})
→ثلاثة، وأربعة عشر كوينتليونًا ومائة وتسعة وخمسون كوادرليونًا ومائتان وخمسة وستون تريليونًا وثلاثمائة وثمانية وخمسون مليارًا وتسعمائة وتسعة وسبعون مليونًا وثلاثمائة وثلاثة وعشرون ألفًا وثمانمائة وستة وأربعون جزءًا من المائة كوينتليون
20 decimal places
arqam("3.14159", {decRound: 2})
→ثلاثة، وأربعة عشر جزءًا من المائة
arqam("1.005", {currency: "QAR"})
→ريال قطري، ودرهم
arqam("1.2345", {currency: "KWD"})
→دينار كويتي، ومائتان وخمسة وثلاثون فلسًا
#Q44
Q45Can I pass a BigInt?Intermediate

Yes, for whole numbers of any size up to the limit.
It avoids the precision problem of JavaScript numbers.

arqam(9007199254740993n)
→تسعة كوادرليونات وسبعة تريليونات ومائة وتسعة وتسعون مليارًا ومائتان وأربعة وخمسون مليونًا وسبعمائة وأربعون ألفًا وتسعمائة وثلاثة وتسعون
arqam(9007199254740993)
→تسعة كوادرليونات وسبعة تريليونات ومائة وتسعة وتسعون مليارًا ومائتان وأربعة وخمسون مليونًا وسبعمائة وأربعون ألفًا وتسعمائة واثنان وتسعون
#Q45
Q46Can I pass several numbers at once?Intermediate

Yes: pass an array and you get an array of words in the same order, with the same options for each.
An empty array gives an empty array.

arqam(["1", "2", "3"], {currency: "EGP"})
→جنيه مصريجنيهان مصريانثلاثة جنيهات مصرية
arqam([])
→
#Q46
Q47Does the browser's language or region change the words?Advanced

No. The words never depend on the region.
Only the separators inside the brackets can follow a locale, and only if you ask for it with sepThousands (see the "Output" section).

#Q47
Q48Is minus zero written as negative?Advanced

No. -0 is zero, and an amount that is written as zero has no «سالب».

arqam("-0")
→صفر
arqam("-0.001", {currency: "QAR"})
→صفر ريال قطري
#Q48
Q49Can I pass a number with a currency symbol, such as "QR 50"?Beginner

No; pass the number and the code separately.
The page's «سريع» box reads such text, but the engine expects the canonical number.

arqam("QR 50")
→""
arqam("50", {currency: "QAR"})
→خمسون ريالًا قطريًا
#Q49
Q50Can I pass a percentage as text with a space, "25 %"?Beginner

No; write "25%" without a space, or use percent.

arqam("25 %")
→""
arqam("25%")
→خمسة وعشرون بالمائة
#Q50
Q51What about a negative number with spaces, "- 5"?Intermediate

Refused: the minus sign must be next to the number.

arqam("- 5")
→""
arqam("-5")
→سالب خمسة
#Q51
Q52Is a number with a trailing minus (5-) accepted?Intermediate

No; only a leading minus.

arqam("5-")
→""
#Q52
Q53Can I pass a decimal comma, "12,5"?Intermediate

No; convert it to "12.5" first.
The engine cannot know whether the comma is a decimal or a thousands separator.

arqam("12,5".replace(",", "."))
→اثنا عشر، وخمسة أجزاء من العشرة
#Q53
Q54How does a BigInt behave with a currency?Advanced

It is a whole amount of the currency; the figure shows the currency's places.

arqam(1000000n, {currency: "AED", brackets: "end"})
→مليون درهم إماراتي (1,000,000.00 AED)
#Q54
Q55Is the number text trimmed of zero-width characters?Advanced

No; remove direction marks and zero-width spaces (for example copied from a web page) before the call.

arqam("\u200F125")
→""
arqam("\u200F125".replace(/[\u200B-\u200F\u202A-\u202E\u2066-\u2069]/g, ""))
→مائة وخمسة وعشرون
#Q55

13.3 What you get back (19)

Strings, arrays, parts, the figure in brackets and how to show the words.

Q56What does toWords() return?Beginner

A string with the words.
For an array of numbers, an array of strings.

When the number cannot be written, the isNaN value (an empty string unless you change it).

typeof arqam("5")
→"string"
arqam(["5", "x"])
→خمسة""
#Q56
Q57How do I show the words correctly in HTML?Beginner

Put them in an element with dir="rtl" (and lang="ar").
Without it, a figure in brackets or a Latin code can appear on the wrong side.

<p dir="rtl" lang="ar" id="words"></p>
<script>
  document.getElementById("words").textContent =
    arqam("1234.5", {currency: "MAD", brackets: "end"});
</script>
#Q57
Q58How do I add the amount in figures after the words?Beginner

brackets: "end" adds it in brackets after the words; "start" before them.
The figure shows the currency's places and the code.

arqam("1234.5", {currency: "QAR", brackets: "end"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وخمسون درهمًا (1,234.50 QAR)
arqam("5", {currency: "QAR", brackets: "start"})
→(5.00 QAR) خمسة ريالات قطرية
#Q58
Q59How do I get an Arabic comma before و between the groups?Beginner

Switch it on with comma: "on".
It is off by default: «ألف ومائتان وأربعة وثلاثون».

With it on, the comma «،» separates the groups (thousands, millions …), which some readers find easier for long numbers.
The comma before the fraction or the minor unit («، وخمسون درهمًا») is always written.

arqam("1234567")
→مليون ومائتان وأربعة وثلاثون ألفًا وخمسمائة وسبعة وستون
arqam("1234567", {comma: "on"})
→مليون، ومائتان وأربعة وثلاثون ألفًا، وخمسمائة وسبعة وستون
#Q59
Q60What is toParts() and when do I need it?Intermediate

toParts() gives the same words split into their parts: prefix, sign, whole part, fraction, suffix, brackets, the figure, and flags.
Use it when you lay out a document yourself, for example the riyals on one line and the dirhams on another.

arqam.toParts("-1250.5", {currency: "QAR", brackets: "end", prefix: "فقط", suffix: "لا غير"})
→
textفقط سالب ألف ومائتين وخمسين ريالًا قطريًا، وخمسين درهمًا لا غير (-1,250.50 QAR)
validtrue
negativetrue
percentfalse
ordinal""
prefixفقط
signسالب
wholeألف ومائتين وخمسين ريالًا قطريًا
fraction، وخمسين درهمًا
suffixلا غير
brackets"(-1,250.50 QAR)"
figure"-1,250.50 QAR"
#Q60
Q61How do I know from toParts() that the number was not valid?Intermediate

valid is false and text holds the isNaN value.

arqam.toParts("abc").valid
→false
arqam.toParts("12").valid
→true
#Q61
Q62Can I choose the bracket characters?Intermediate

Yes, with bracketsType: any two characters, such as "[]" or "«»".
The default is the round brackets.

arqam("5", {currency: "QAR", brackets: "end", bracketsType: "[]"})
→خمسة ريالات قطرية [5.00 QAR]
arqam("5", {currency: "QAR", brackets: "end", bracketsType: "«»"})
→خمسة ريالات قطرية «5.00 QAR»
#Q62
Q63What label can appear next to the figure in brackets?Intermediate

numSymbol: "code" (QAR, the default), "english" (QR), "native" (ر.ق.), "sign" (the Symbol, one character: ⃁ for SAR, € for EUR, $ for USD), "name" (the currency name), "none" (the figure only), or any text of your own.
An empty sign falls back: English to Native, Native to English, Symbol to Native, and then to the ISO code (manual 12.11.1).

"latin" and "symbol" are the earlier names of "english" and "native".

arqam("12.5", {currency: "QAR", brackets: "end", numSymbol: "symbol"})
→اثنا عشر ريالًا قطريًا، وخمسون درهمًا (12.50 ر.ق.)
arqam("12.5", {currency: "QAR", brackets: "end", numSymbol: "latin"})
→اثنا عشر ريالًا قطريًا، وخمسون درهمًا (12.50 QR)
arqam("12.5", {currency: "QAR", brackets: "end", numSymbol: "none"})
→اثنا عشر ريالًا قطريًا، وخمسون درهمًا (12.50)
arqam("12.5", {currency: "QAR", brackets: "end", numSymbol: "ريال"})
→اثنا عشر ريالًا قطريًا، وخمسون درهمًا (12.50 ريال)
arqam("12.5", {currency: "SAR", brackets: "end", numSymbol: "sign"})
→اثنا عشر ريالًا سعوديًا، وخمسون هللةً (12.50 ⃁)
#Q63
Q64Can the figure in brackets use other separators?Intermediate

sepThousands and sepDecimal set them, either as characters or as a locale tag such as "fr" or "de".
They only change the figure in brackets, never the words.

arqam("1234.5", {currency: "SAR", brackets: "end", sepThousands: ".", sepDecimal: ","})
→ألف ومائتان وأربعة وثلاثون ريالًا سعوديًا، وخمسون هللةً (1.234,50 SAR)
arqam("1234.5", {currency: "SAR", brackets: "end", sepThousands: "fr"})
→ألف ومائتان وأربعة وثلاثون ريالًا سعوديًا، وخمسون هللةً (1 234.50 SAR)
#Q64
Q65Can the figure in brackets use Arabic-Eastern digits?Intermediate

Yes, with arabicNumbers: "on".

arqam("1234.5", {currency: "AED", brackets: "end", arabicNumbers: "on"})
→ألف ومائتان وأربعة وثلاثون درهمًا إماراتيًا، وخمسون فلسًا (١٬٢٣٤٫٥٠ AED)
#Q65
Q66Why does the figure show 1,234.00 for a whole amount?Intermediate

With a currency, the figure shows the currency's places by default (currDecForce: "on"), as on invoices.
Turn it off to show the number as given.

arqam("1234", {currency: "QAR", brackets: "end"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا (1,234.00 QAR)
arqam("1234", {currency: "QAR", brackets: "end", currDecForce: "off"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا (1,234 QAR)
#Q66
Q67Can I put only the fraction in brackets?Intermediate

brackets: "decimals" puts the fraction's words in brackets.

arqam("5.25", {brackets: "decimals"})
→خمسة، (وخمسة وعشرون جزءًا من المائة)
#Q67
Q68How do I build my own layout from the parts?Advanced

Take the parts you need and join them yourself.
Here the riyals and the dirhams go on separate lines of a cheque.

const p = arqam.toParts("1250.5", {currency: "QAR"});
line1.textContent = p.whole;                         // the riyals
line2.textContent = p.fraction.replace(/^،?\s*و/, ""); // the dirhams, without "، و"
arqam.toParts("1250.5", {currency: "QAR"}).whole
→ألف ومائتان وخمسون ريالًا قطريًا
arqam.toParts("1250.5", {currency: "QAR"}).fraction
→، وخمسون درهمًا
#Q68
Q69Does toParts() accept an array?Advanced

Yes, like toWords(): an array gives an array of parts.

arqam.toParts(["0.5", "25%"], "QAR").map(p => p.whole)
→""خمسة وعشرون بالمائة
#Q69
Q70Is the output text normalised in any way?Advanced

The words use the standard Arabic letters (U+0600 block), single spaces, the Arabic comma «،» and, with tashkeel, the standard combining marks.
There are no invisible direction marks in the text; direction is the job of the element that shows it.

#Q70
Q71Does the output ever contain HTML?Beginner

No. toWords() returns plain text, which you can put in textContent safely.
Only your own colouring code creates HTML.

#Q71
Q72How do I put the words in a PDF?Intermediate

Use any PDF library with an Arabic font and right-to-left text shaping (or print an HTML page to PDF).
The words are standard Unicode text.

#Q72
Q73How long can the words be?Intermediate

As long as the number needs: there is no limit on the number, and a number of thousands of digits gives many thousand words.
Use compact for long numbers in tables.

arqam("9".repeat(30)).split(" ").length + " words"
→"39 words"
arqam("9".repeat(30), {compact: "on"})
→999 وكتليونًا و999 سيبتليونًا و999 سكستليونًا و999 كوينتليونًا و999 كوادرليونًا و999 تريليونًا و999 مليارًا و999 مليونًا و999 ألفًا و999
#Q73
Q74What is in the figure of toParts() for a percentage or an ordinal?Advanced

The figure with its % sign; an ordinal has no figure.

arqam.toParts("25%", {brackets: "end"}).figure
→"25%"
arqam.toParts("21", {ordinal: "masculine", brackets: "end"}).figure
→""
#Q74

13.4 Colouring the words and the tashkeel (19)

Colour the groups, the currency, the fraction, the tanween or every vowel mark; the methods that work in every browser, with live results.

Q75Can Arqam colour the words?Beginner

The engine gives text, and your page colours it.
Two kinds of colouring are possible: by parts of the number (groups, currency names, punctuation, the fraction), using the markers of split: "on"; and by vowel marks (the tanween, or every mark), using the tashkeel in the text.

The functions in this section do both; each result below is drawn by the manual itself.

arqamColourGroups(arqam("1234.5", {currency: "QAR", split: "on"}))
ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وخمسون درهمًا
arqamColourTanween(arqam("1234.5", {currency: "QAR", tashkeel: "full"}))
أَلْف وَمِائَتَانِ وَأَرْبَعَة وَثَلَاثُونَ رِيَالا قَطَرِيا، وَخَمْسُونَ دِرْهَما
#Q75
Q76Where are the colour functions?Beginner

They are short and have no dependencies; copy them into your page.
They are not part of the engine, because colours belong to the page's design.

// Arqam colour helpers (manual, chapter 13). Copy them into your page.
const ARQAM_MARKS = {fathatan: "\u064B", dammatan: "\u064C", kasratan: "\u064D", fatha: "\u064E",
                     damma: "\u064F", kasra: "\u0650", shadda: "\u0651", sukun: "\u0652"};
const arqamEsc = t => String(t).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
// The vowel marks in colour, in every browser. A mark inside its own <span> keeps the colour of its letter in
// Chrome and Edge, so the words are drawn in layers in the same place: one layer per colour with only those marks,
// and the words with every other mark on top. Kerning is off so that every layer has exactly the same width
// (with kerning on, a font may space two letters differently when a mark between them is removed). A shadda
// takes the colour of the coloured vowel on the same letter, so that the two keep their stacked places.
// colours: {mark: colour}, e.g. {"\u064B": "red"}.
function arqamColourMarks(text, colours, ink = "inherit") {
  const SHADDA = "ّ", isMark = ch => /[ً-ْ]/.test(ch);
  const clusters = [];                                   // each letter with the marks that follow it
  for (const ch of text) if (isMark(ch) && clusters.length) clusters[clusters.length - 1].push(ch); else clusters.push([ch]);
  const used = [...new Set(Object.values(colours))], layer = {};
  for (const c of used) layer[c] = "";
  let top = "";
  for (const [letter, ...marks] of clusters) {
    const vowel = marks.map(m => m !== SHADDA && colours[m]).find(Boolean);
    const colourOf = m => (m === SHADDA && vowel) || colours[m] || "";
    top += letter + marks.filter(m => !colourOf(m)).join("");
    for (const c of used) layer[c] += letter + marks.filter(m => colourOf(m) === c).join("");
  }
  return '<span style="display:inline-grid;font-kerning:none">' +
         used.map(c => '<span aria-hidden="true" style="grid-area:1/1;color:' + c + '">' + arqamEsc(layer[c]) + "</span>").join("") +
         '<span style="grid-area:1/1;color:' + ink + '">' + arqamEsc(top) + "</span></span>";
}
// Only the tanween (ً ٌ ٍ) in one colour.
const arqamColourTanween = (text, colour = "#d32f2f") =>
  arqamColourMarks(text, {"\u064B": colour, "\u064C": colour, "\u064D": colour});
// Every kind of mark in its own colour (the page's palette).
const ARQAM_MARK_COLOURS = {"\u064B": "#d32f2f", "\u064C": "#c2185b", "\u064D": "#7b1fa2", "\u064E": "#1565c0",
                            "\u064F": "#2e7d32", "\u0650": "#ef6c00", "\u0651": "#6d4c41", "\u0652": "#546e7a"};
const arqamColourAllMarks = text => arqamColourMarks(text, ARQAM_MARK_COLOURS);
// The groups, currency names, punctuation and fraction in colour, from the words of {split: "on"}.
// |p punctuation and fixed words · |c currency names · |f| the fraction starts · | a new group
function arqamColourGroups(marked, palette = ["#1565c0", "#2e7d32", "#5d4037", "#00838f"],
                           currency = "#c62828", punct = "#555", fraction = "#ef6c00") {
  let html = "", group = 0, frac = false;
  for (const seg of marked.split("|")) {
    if (seg === "") continue;
    if (seg === "f") { frac = true; continue; }
    const colour = seg[0] === "p" ? punct : seg[0] === "c" ? currency : frac ? fraction : palette[group++ % palette.length];
    const text = seg[0] === "p" || seg[0] === "c" ? seg.slice(1) : seg;
    html += '<span style="color:' + colour + '">' + arqamEsc(text) + "</span>";
  }
  return html;
}
// Both at once: the groups in colour and the tanween in its own colour on top of them.
function arqamColourGroupsAndTanween(marked, tanween = "#d500f9") {
  const plain = marked.replace(/\|[pcf]?/g, "");
  const noTanween = marked.replace(/\u0651?[\u064B-\u064D]/g, "");        // a shadda goes with its tanween
  const onlyTanween = plain.replace(/[\u064E-\u0652](?![\u064B-\u064D])/g, "");
  return '<span style="display:inline-grid;font-kerning:none"><span aria-hidden="true" style="grid-area:1/1;color:' + tanween + '">' +
         arqamEsc(onlyTanween) + '</span><span style="grid-area:1/1">' + arqamColourGroups(noTanween) + "</span></span>";
}
// The last mark of every word (the case ending) in colour.
function arqamColourEndings(text, colour = "#d32f2f") {
  const top = [], layer = [];
  for (const w of text.split(" ")) {
    const m = w.match(/[ً-ْ]+(?=[^ً-ْ]*$)/);   // the last group of marks
    if (!m) { top.push(w); layer.push(w); continue; }
    const before = w.slice(0, m.index), after = w.slice(m.index + m[0].length);
    top.push(before + after);
    layer.push(before.replace(/[ً-ْ]/g, "") + m[0] + after);
  }
  return '<span style="display:inline-grid;font-kerning:none"><span aria-hidden="true" style="grid-area:1/1;color:' + colour + '">' +
         arqamEsc(layer.join(" ")) + '</span><span style="grid-area:1/1">' + arqamEsc(top.join(" ")) + "</span></span>";
}
#Q76
Q77How do I colour the groups (thousands, hundreds …) in different colours?Beginner

Ask for the markers with split: "on" and pass the words to arqamColourGroups().
Each group gets the next colour of the palette; currency names, punctuation and the fraction have their own colours.

arqamColourGroups(arqam("2345678.25", {currency: "USD", split: "on"}))
مليونان وثلاثمائة وخمسة وأربعون ألفًا وستمائة وثمانية وسبعون دولارًا أمريكيًا، وخمسة وعشرون سنتًا
#Q77
Q78How do I colour only the tanween?Beginner

Ask for tashkeel (any level that has tanween: "alif", "fatha", "tanween", "endings" or "full") and pass the words to arqamColourTanween().

arqamColourTanween(arqam("21", {currency: "QAR", tashkeel: "full"}))
وَاحِد وَعِشْرُونَ رِيَالا قَطَرِيا
arqamColourTanween(arqam("21", {currency: "QAR", tashkeel: "alif"}), "#1565c0")
واحد وعشرون ريالا قطريا
#Q78
Q79How do I colour every vowel mark in its own colour?Beginner

arqamColourAllMarks() gives each of the eight marks (the three tanween, fatha, damma, kasra, shadda, sukun) its own colour.
The page's «تلوين التشكيل» draws its colours with the same layer method.

arqamColourAllMarks(arqam("1250.5", {currency: "QAR", tashkeel: "full"}))
ألف ومائتان وخمسون ريالا قطريا، وخمسون درهما
#Q79
Q80Why does a <span> around a vowel mark not change its colour in Chrome?Intermediate

Chrome and Edge draw a letter and its marks as one shape (a cluster) and give the whole cluster the colour of the letter; the colour of a span around the mark alone is ignored.
Firefox does colour it.

The layer method used here draws the words twice in exactly the same place: underneath, a layer with only the marks to colour, in their colour; on top, the words with every other mark.
It works in every browser, and the letters still join normally.

Kerning is turned off in the layers so that they have exactly the same width.

<!-- does not work in Chrome: the fathatan stays black -->
ريال<span style="color:red">ً</span>ا
<!-- works everywhere: two layers in the same place -->
<span style="display:inline-grid;font-kerning:none">
  <span style="grid-area:1/1;color:red" aria-hidden="true">ريالًا</span>  <!-- only the tanween -->
  <span style="grid-area:1/1">ريالا</span>                              <!-- the rest -->
</span>
#Q80
Q81Can I choose my own colours for each mark?Intermediate

arqamColourMarks(text, colours) takes an object from a mark to a colour.
Marks that are not listed keep the colour of the text.

arqamColourMarks(arqam("12", {currency: "QAR", tashkeel: "full"}), {[ARQAM_MARKS.fatha]: "#1565c0", [ARQAM_MARKS.kasra]: "#ef6c00", [ARQAM_MARKS.fathatan]: "#d32f2f"})
اثْنا عشر ريالا قطريا
#Q81
Q82How do I colour the groups and the tanween at the same time?Intermediate

arqamColourGroupsAndTanween() takes the words of split: "on" with tashkeel: the groups get their colours and the tanween is drawn in its own colour on top.

arqamColourGroupsAndTanween(arqam("1234.5", {currency: "QAR", tashkeel: "full", split: "on"}))
أَلْف وَمِائَتَانِ وَأَرْبَعَة وَثَلَاثُونَ رِيَالا قَطَرِيّا، وَخَمْسُونَ دِرْهَما
#Q82
Q83How do I show the case endings (the last mark of each word) in colour?Intermediate

arqamColourEndings() colours the last mark group of every word, which is where the iʿrāb shows.
Useful for teaching, with tashkeel: "full" or "endings".

arqamColourEndings(arqam("2000", {currency: "QAR", tashkeel: "full", ierab: "nasb"}))
أَلْفي رِيَال قَطَرِي
arqamColourEndings(arqam("2000", {currency: "QAR", tashkeel: "full"}))
أَلْفا رِيَال قَطَرِي
#Q83
Q84Can I compare the three cases in colour?Intermediate

Yes: call the engine three times with ierab raf, nasb and jarr and colour the endings of each.

["raf", "nasb", "jarr"].map(c => c + ": " + arqamColourEndings(arqam("12", {currency: "QAR", tashkeel: "full", ierab: c}))).join("<br>")
raf: اثْنا عَشَر رِيَالا قَطَرِيا
nasb: اثْني عَشَر رِيَالا قَطَرِيا
jarr: اثْني عَشَر رِيَالا قَطَرِيا
#Q84
Q85What do the split markers mean?Intermediate

|p starts punctuation or a fixed word (the comma and و, فقط, لا غير, the brackets); |c starts a currency name; |f| marks where the fraction starts; a bare | starts a new group.
Remove them with .replace(/\|[pcf]?/g, "") to get the plain words.

arqam("12.5", {currency: "QAR", split: "on", prefix: "فقط"})
→|pفقط| اثنا عشر |cريالًا قطريًا|p، و|f||f|خمسون |cدرهمًا
arqam("12.5", {currency: "QAR", split: "on", prefix: "فقط"}).replace(/\|[pcf]?/g, "")
→فقط اثنا عشر ريالًا قطريًا، وخمسون درهمًا
#Q85
Q86Does split change the words?Intermediate

No: removing the markers gives exactly the words without split.
The tests check this.

arqam("987654.32", {currency: "KWD", split: "on"}).replace(/\|[pcf]?/g, "") === arqam("987654.32", {currency: "KWD"})
→true
#Q86
Q87Can I use CSS classes instead of inline colours?Intermediate

Yes. Change the functions to write class="…" instead of style="color:…", and define the colours in your CSS, including for dark mode.
The manual's 12.15 shows a version with classes.

.arqam-g0 {color: #1565c0} .arqam-g1 {color: #2e7d32} .arqam-cur {color: #c62828}
@media (prefers-color-scheme: dark) { .arqam-g0 {color: #90caf9} .arqam-cur {color: #ef9a9a} }
#Q87
Q88Does the colouring work for dates and times?Intermediate

The vowel-mark colouring works on any Arabic text with tashkeel, so also on toDate() and toTime(). split works for toWords() and toParts().

arqamColourTanween(arqam.toTime("15:45", {tashkeel: "full"}))
السَّاعَةُ الثَّالِثَةُ وَخَمْس وَأَرْبَعُونَ دَقِيقَة عَصْرا
arqamColourAllMarks(arqam.toDate("18/11/2026", {tashkeel: "full"}))
الثامن عشر من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد
#Q88
Q89Is the coloured text still read correctly by screen readers and search?Advanced

The colour layers carry aria-hidden="true", so a screen reader reads the words once.
A search engine or a user who selects the text may see the words more than once, so keep a plain copy for copying (a copy button that copies toWords() without colours), as the page does.

#Q89
Q90Do the layers line up with every font?Advanced

The marks have no width of their own, and the functions turn kerning off (font-kerning:none), because with kerning a font can space two letters differently when a mark between them is removed; with it off, every layer has the same width and the letters fall in the same places.
A vowel drawn without its shadda would sit lower than with it, so a shadda always goes into the layer of the coloured vowel on the same letter (it takes that colour).

Use the same font, size and line height for all layers (the functions do this by putting them in the same element).

#Q90
Q91Can long coloured text wrap over several lines?Advanced

The functions use an inline grid, which keeps one amount on one line.
For a paragraph that should wrap, use display:grid on a block element (a div) instead: both layers then have the same width and wrap at the same places.

function arqamColourBlock(text, colours) {
  return arqamColourMarks(text, colours).replace(/display:inline-grid/g, 'display:grid');
}
#Q91
Q92How do I colour in a canvas or an image?Advanced

Draw the words twice with fillText() at the same point: first the text with only the marks to colour (in their colour), then the text with the other marks (in black).
The page's image export draws the word and mark colours this way.

ctx.direction = "rtl"; ctx.font = "40px Scheherazade"; ctx.fontKerning = "none";
ctx.fillStyle = "#d32f2f"; ctx.fillText(onlyTanween, x, y);
ctx.fillStyle = "#111";    ctx.fillText(withoutTanween, x, y);
#Q92
Q93Can I colour the words in Word or Excel?Advanced

Office colours combining marks per character, so you can write the text from your program and set the colour of each mark (for example with a docx or xlsx library: one run per mark).
The two-layer trick is only needed in browsers.

#Q93

13.5 Currencies (27)

Codes, minor units, crypto, your own currencies and the country adjective.

Q94Which currencies are built in?Beginner

Every current ISO 4217 currency, some withdrawn ones that still appear on old documents, and the main cryptocurrencies.
arqam.currencies is the table, by code; use in to check a code.

Object.keys(arqam.currencies).length
→188
["QAR", "SAR", "EUR", "BTC", "XYZ"].map(c => c + ": " + (c in arqam.currencies)).join(", ")
→"QAR: true, SAR: true, EUR: true, BTC: true, XYZ: false"
#Q94
Q95Is the currency code case-sensitive?Beginner

No: a known code is taken in any letter case and without spaces ("qar", " QAR "), as Intl does.
An unknown code is an error that names the nearest code.

arqam("5", {currency: "qar"})
→خمسة ريالات قطرية
arqam("5", {currency: "QAT"})
→RangeError: arqam.toWords: unknown currency "QAT" (did you mean "QAR"?): add it with registerCurrency(), or give majorSingle and majorPlural in the same call
#Q95
Q96What happens with an unknown currency code?Beginner

A call with a code the table does not have throws a TypeError that names the code (and suggests a near one), so a typing mistake is never written as a plain number.
Letter case and spaces do not matter: "qar" is QAR.

To use a new currency, register it (see below) or give its names (majorSingle, majorPlural) in the same call.

arqam("5", {currency: "QAT"})
→RangeError: arqam.toWords: unknown currency "QAT" (did you mean "QAR"?): add it with registerCurrency(), or give majorSingle and majorPlural in the same call
#Q96
Q97How are the one, two and three-to-ten forms handled?Beginner

By the rules of Arabic: one and two follow the noun (دولار واحد، دولاران اثنان), three to ten take the plural in the genitive and the opposite gender, eleven to ninety-nine take the singular in the accusative, hundreds and thousands take the singular in the genitive.

arqam("1", {currency: "USD"})
→دولار أمريكي
arqam("2", {currency: "USD"})
→دولاران أمريكيان
arqam("3", {currency: "USD"})
→ثلاثة دولارات أمريكية
arqam("11", {currency: "USD"})
→أحد عشر دولارًا أمريكيًا
arqam("100", {currency: "USD"})
→مائة دولار أمريكي
#Q97
Q98Does the engine know which currencies are feminine?Beginner

Yes. A feminine currency such as the lira changes the number words (ثلاث ليرات، إحدى عشرة ليرة).

arqam("3", {currency: "SYP"})
→ثلاث ليرات سورية
arqam("11", {currency: "TRY"})
→إحدى عشرة ليرةً تركيةً
#Q98
Q99How are the minor units (fils, cents, halalas) written?Beginner

With their own name and gender, after a comma and و.
Kuwaiti dinars have 1,000 fils, so the fraction has three places.

arqam("12.5", {currency: "SAR"})
→اثنا عشر ريالًا سعوديًا، وخمسون هللةً
arqam("1250.5", {currency: "KWD"})
→ألف ومائتان وخمسون دينارًا كويتيًا، وخمسمائة فلس
arqam("0.01", {currency: "USD"})
→سنت أمريكي
#Q99
Q100How do I leave out the country (ريال instead of ريال قطري)?Beginner

ignoreCountry: "on".
A qualifier that is part of the name (for example «في الساعة» of a unit) is never dropped.

arqam("5", {currency: "QAR", ignoreCountry: "on"})
→خمسة ريالات
#Q100
Q101Why does 2.675 riyals say sixty-eight dirhams, not sixty-seven?Intermediate

Because the library rounds as Intl does: an amount half up to its currency's places, carried into the whole number when it must.
A cheque that must say exactly what was written, digit for digit, cuts instead: rounding: "off" (Intl's roundingMode: "trunc").

arqam("2.675", {currency: "QAR"})
→ريالان قطريان، وثمانية وستون درهمًا
rounded
arqam("2.675", {currency: "QAR", rounding: "off"})
→ريالان قطريان، وسبعة وستون درهمًا
cut
arqam("9.999", {currency: "QAR"})
→عشرة ريالات قطرية
carried into the riyals
#Q101
Q102What about currencies with no minor unit, such as the yen?Intermediate

They have no decimal places; a fraction is cut (or rounded with rounding).

arqam("2", {currency: "JPY"})
→ينان يابانيان
arqam("0.5", {currency: "JPY"})
→ين ياباني
arqam("0.5", {currency: "JPY", rounding: "on"})
→ين ياباني
#Q102
Q103How are cryptocurrencies written?Intermediate

By their unit name, with the decimals as given (they have no fixed number of places).

arqam("5", {currency: "BTC"})
→خمسة بتكوين
arqam("0.00512", {currency: "BTC"})
→خمسمائة واثنا عشر جزءًا من المائة ألف من البتكوين
#Q103
Q104How do I add my own currency?Intermediate

registerCurrency(code, attributes).
A new code needs at least a singular and a plural name; the minor unit, gender, places and symbols are optional.

It stays for the session.

arqam.registerCurrency("ZZZ", { // the number currDecimal: 2, // the names, without tashkeel majorSingle: "كوكو", majorPlural: "كوكوات", minorSingle: "كاكا", minorPlural: "كاكات" }) && ""
→""
arqam("2500.35", {currency: "ZZZ"})
→ألفان وخمسمائة كوكو، وخمسة وثلاثون كاكا
#Q104
Q105How do I register a feminine currency?Intermediate

Set majorGender: 1 (and minorGender: 1 for a feminine minor unit).

arqam.registerCurrency("LRA", { majorSingle: "ليرة", majorPlural: "ليرات", majorGender: 1, // 1 = feminine minorSingle: "قرش", minorPlural: "قروش" }) && ""
→""
arqam("3.5", {currency: "LRA"})
→ثلاث ليرات، وخمسون قرشًا
arqam("11", {currency: "LRA"})
→إحدى عشرة ليرةً
#Q105
Q106How do I add the country adjective (ريال عماني) to my currency?Intermediate

Give country: the adjective is made from it with the nisba rules.
Or give majorSingleC/majorPluralC yourself.

arqam.registerCurrency("ZZO", {majorSingle: "ريال", majorPlural: "ريالات", country: "عمان"}) && ""
→""
arqam("3", {currency: "ZZO"})
→ثلاثة ريالات عمانية
arqam("1", {currency: "ZZO"})
→ريال عماني
#Q106
Q107Can I change a built-in currency, for example its names?Intermediate

Yes: registerCurrency() with an existing code changes only the attributes you give.
The change lasts for the session (reset() does not undo it).

arqam.registerCurrency("QAR", {majorSingle: "ريال", majorPlural: "ريالات", majorSingleT: "رِيَال", majorPluralT: "رِيَالَاتٍ"}) && ""
→""
arqam("3", {currency: "QAR"})
→ثلاثة ريالات قطرية
#Q107
Q108How do I give the full-tashkeel forms of a currency I register?Intermediate

Give each name again with a T at the end of its attribute: majorSingleT, majorPluralT (the plural in the genitive, as after ثلاثة), majorSingleCT and majorPluralCT (the adjective), and minorSingleT, minorPluralT, minorSingleCT, minorPluralCT for the minor unit.
They are used with full tashkeel; a name without its T form is used as it is.

arqam.registerCurrency("ZZT", { // the number currDecimal: 3, // the names, without tashkeel majorSingle: "دينار", majorSingleC: "تجريبي", majorPlural: "دنانير", minorSingle: "فلس", minorPlural: "فلوس", // the same names with tashkeel majorSingleT: "دِينَار", majorSingleCT: "تَجْرِيبِيّ", majorPluralT: "دَنَانِيرَ", minorSingleT: "فَلْس", minorPluralT: "فُلُوسٍ" }) && ""
→""
arqam("11", {currency: "ZZT", tashkeel: "full"})
→أَحَدَ عَشَرَ دِينَارًا تَجْرِيبِيًّا
arqam("3.5", {currency: "ZZT", tashkeel: "full"})
→ثَلَاثَةُ دَنَانِيرَ تَجْرِيبِيَّةٍ، وَخَمْسُمِائَةِ فَلْسٍ
#Q108
Q109What does registerCurrency() check?Intermediate

The code (3 to 8 letters or digits starting with a letter), that a new currency has a singular and a plural, that a singular and its plural go together, and the values of the numeric attributes.
A mistake throws a TypeError that says what is wrong.

arqam.registerCurrency("AB", {majorSingle: "x"})
→TypeError: arqam.registerCurrency: the code must be 3 to 8 letters or digits starting with a letter, e.g. "ZZZ" or "E01"
arqam.registerCurrency("ABC", {majorSingle: "كتاب"})
→TypeError: arqam.registerCurrency: a new currency needs majorSingle and majorPlural
#Q109
Q110Can I give my currency its own symbols?Intermediate

symbolLatin (English), symbolNative (Native) and symbol (one character); they are used by numSymbol: "english", "native" and "sign".

arqam.registerCurrency("ZZS", { // the number currDecimal: 2, // the names, without tashkeel majorSingle: "كوكو", majorPlural: "كوكوات", // the symbols symbolNative: "ك", symbolLatin: "KK" }) && ""
→""
arqam("7.5", {currency: "ZZS", brackets: "end", numSymbol: "symbol"})
→سبعة كوكوات، وخمسون جزءًا من المائة من الكوكو (7.50 ك)
arqam("7.5", {currency: "ZZS", brackets: "end", numSymbol: "latin"})
→سبعة كوكوات، وخمسون جزءًا من المائة من الكوكو (7.50 KK)
#Q110
Q111What does registerCurrency() return?Advanced

A copy of the currency's row in the table (the internal list of its names and settings).
You rarely need it; most code ignores it, which is why the examples add && "".

arqam.registerCurrency("ZZR", {majorSingle: "كوكو", majorPlural: "كوكوات"}).slice(0, 6)
→[2,"كوكو","","كوكوات","",""]
#Q111
Q112Is a registered currency shared between instances?Advanced

Yes. The currency table is shared by the global object and every instance from createArqam(); only the options are separate.

const i = arqam.createArqam()
arqam.registerCurrency("ZZI", {majorSingle: "كوكو", majorPlural: "كوكوات"}) && ""
→""
i.toWords("3", "ZZI")
→ثلاثة كوكوات
#Q112
Q113How do I write a currency with tashkeel when I registered it?Advanced

Give the names with full tashkeel too (majorSingleT, majorPluralT, minorSingleT …).
Without them, full tashkeel marks the number words and leaves your names as given.

arqam.registerCurrency("ZZT", {majorSingle: "كتاب", majorPlural: "كتب", majorSingleT: "كِتَاب", majorPluralT: "كُتُبٍ"}) && ""
→""
arqam("3", {currency: "ZZT", tashkeel: "full"})
→ثَلَاثَةُ كُتُبٍ
#Q113
Q114Which currencies are withdrawn but still accepted?Advanced

Some currencies withdrawn recently stay in the table so that old documents can still be written, for example CUC (withdrawn 2021), HRK, the Croatian kuna (2023, replaced by the euro), SLL, the old Sierra Leone leone (2024, replaced by SLE), ZWL (2024) and ANG (2025).
Check a code with in arqam.currencies.

arqam("100", {currency: "CUC"})
→مائة بيزو كوبي
arqam("3", {currency: "HRK"})
→ثلاث كونات كرواتية
arqam("2.5", {currency: "SLL"})
→ليونان سيراليونيان، وخمسون سنتًا
["CUC", "HRK", "SLL", "ZWL", "ANG"].every(c => c in arqam.currencies)
→true
#Q114
Q115How do I write an amount that is only the minor unit, such as 50 fils?Beginner

Pass the amount in the major unit; below one there is no whole part, so only the minor unit is written.

arqam("0.05", {currency: "KWD"})
→خمسون فلسًا كويتيًا
arqam("0.5", {currency: "USD"})
→خمسون سنتًا أمريكيًا
#Q115
Q116Which currencies have no country adjective?Beginner

A currency shared by several countries, such as the euro, is written without one.

arqam("1", {currency: "EUR"})
→يورو
arqam("100", {currency: "EUR"})
→مائة يورو
#Q116
Q117How do I find the minor unit and places of a currency?Intermediate

Write 0.01 (or 0.001) of it; the minor unit is named.
Or read the table row.

arqam("0.01", {currency: "EGP"})
→قرش مصري
arqam("0.001", {currency: "OMR"})
→بيسة عمانية
#Q117
Q118Can one call write two currencies?Intermediate

No; call once per currency and join the texts.

arqam("100", {currency: "USD"}) + " أو ما يعادلها " + arqam("364", {currency: "USD"})
→مائة دولار أمريكي أو ما يعادلها ثلاثمائة وأربعة وستون دولارًا أمريكيًا
#Q118
Q119How are the Gulf currency names agreed with large amounts?Advanced

The same rules as any noun; the country adjective follows the noun.

arqam("1000000", {currency: "AED"})
→مليون درهم إماراتي
arqam("2000000", {currency: "AED"})
→مليونا درهم إماراتي
arqam("3000000", {currency: "AED"})
→ثلاثة ملايين درهم إماراتي
#Q119
Q120Is a registered currency kept after reloading the page?Advanced

No: registerCurrency() lasts for the session.
Register your currencies when your page or service starts.

#Q120

13.6 Currencies one by one (27)

The currencies asked about most, with one, two, three, eleven and a fraction.

Q121How is the Qatari riyal (QAR) written?Beginner

Here are the main forms; every other amount follows the same rules.

arqam(["1", "2", "3", "11", "100"], {currency: "QAR"})
→ريال قطريريالان قطريانثلاثة ريالات قطريةأحد عشر ريالًا قطريًامائة ريال قطري
arqam("1250.5", {currency: "QAR"})
→ألف ومائتان وخمسون ريالًا قطريًا، وخمسون درهمًا
#Q121
Q122How is the Saudi riyal (SAR) written?Beginner

Here are the main forms; every other amount follows the same rules.

arqam(["1", "2", "3", "11", "100"], {currency: "SAR"})
→ريال سعوديريالان سعوديانثلاثة ريالات سعوديةأحد عشر ريالًا سعوديًامائة ريال سعودي
arqam("1250.5", {currency: "SAR"})
→ألف ومائتان وخمسون ريالًا سعوديًا، وخمسون هللةً
#Q122
Q123How is the UAE dirham (AED) written?Beginner

Here are the main forms; every other amount follows the same rules.

arqam(["1", "2", "3", "11", "100"], {currency: "AED"})
→درهم إماراتيدرهمان إماراتيانثلاثة دراهم إماراتيةأحد عشر درهمًا إماراتيًامائة درهم إماراتي
arqam("1250.5", {currency: "AED"})
→ألف ومائتان وخمسون درهمًا إماراتيًا، وخمسون فلسًا
#Q123
Q124How is the Kuwaiti dinar (KWD) written?Beginner

Here are the main forms; every other amount follows the same rules.
It has three decimal places: a thousand of its minor unit make one.

arqam(["1", "2", "3", "11", "100"], {currency: "KWD"})
→دينار كويتيديناران كويتيانثلاثة دنانير كويتيةأحد عشر دينارًا كويتيًامائة دينار كويتي
arqam("1250.5", {currency: "KWD"})
→ألف ومائتان وخمسون دينارًا كويتيًا، وخمسمائة فلس
#Q124
Q125How is the Bahraini dinar (BHD) written?Beginner

Here are the main forms; every other amount follows the same rules.
It has three decimal places: a thousand of its minor unit make one.

arqam(["1", "2", "3", "11", "100"], {currency: "BHD"})
→دينار بحرينيديناران بحرينيانثلاثة دنانير بحرينيةأحد عشر دينارًا بحرينيًامائة دينار بحريني
arqam("1250.5", {currency: "BHD"})
→ألف ومائتان وخمسون دينارًا بحرينيًا، وخمسمائة فلس
#Q125
Q126How is the Omani rial (OMR) written?Beginner

Here are the main forms; every other amount follows the same rules.
It has three decimal places: a thousand of its minor unit make one.

arqam(["1", "2", "3", "11", "100"], {currency: "OMR"})
→ريال عمانيريالان عمانيانثلاثة ريالات عمانيةأحد عشر ريالًا عمانيًامائة ريال عماني
arqam("1250.5", {currency: "OMR"})
→ألف ومائتان وخمسون ريالًا عمانيًا، وخمسمائة بيسة
#Q126
Q127How is the Jordanian dinar (JOD) written?Beginner

Here are the main forms; every other amount follows the same rules.
It has three decimal places: a thousand of its minor unit make one.

arqam(["1", "2", "3", "11", "100"], {currency: "JOD"})
→دينار أردنيديناران أردنيانثلاثة دنانير أردنيةأحد عشر دينارًا أردنيًامائة دينار أردني
arqam("1250.5", {currency: "JOD"})
→ألف ومائتان وخمسون دينارًا أردنيًا، وخمسمائة فلس
#Q127
Q128How is the Egyptian pound (EGP) written?Beginner

Here are the main forms; every other amount follows the same rules.

arqam(["1", "2", "3", "11", "100"], {currency: "EGP"})
→جنيه مصريجنيهان مصريانثلاثة جنيهات مصريةأحد عشر جنيهًا مصريًامائة جنيه مصري
arqam("1250.5", {currency: "EGP"})
→ألف ومائتان وخمسون جنيهًا مصريًا، وخمسون قرشًا
#Q128
Q129How is the Iraqi dinar (IQD) written?Beginner

Here are the main forms; every other amount follows the same rules.
It has three decimal places: a thousand of its minor unit make one.

arqam(["1", "2", "3", "11", "100"], {currency: "IQD"})
→دينار عراقيديناران عراقيانثلاثة دنانير عراقيةأحد عشر دينارًا عراقيًامائة دينار عراقي
arqam("1250.5", {currency: "IQD"})
→ألف ومائتان وخمسون دينارًا عراقيًا، وخمسمائة فلس
#Q129
Q130How is the Lebanese pound (LBP) written?Beginner

Here are the main forms; every other amount follows the same rules.
Its name is feminine, so three to ten take the form without ة (ثلاث).

arqam(["1", "2", "3", "11", "100"], {currency: "LBP"})
→ليرة لبنانيةليرتان لبنانيتانثلاث ليرات لبنانيةإحدى عشرة ليرةً لبنانيةًمائة ليرة لبنانية
arqam("1250.5", {currency: "LBP"})
→ألف ومائتان وخمسون ليرةً لبنانيةً، وخمسون قرشًا
#Q130
Q131How is the Syrian pound (SYP) written?Beginner

Here are the main forms; every other amount follows the same rules.
Its name is feminine, so three to ten take the form without ة (ثلاث).

arqam(["1", "2", "3", "11", "100"], {currency: "SYP"})
→ليرة سوريةليرتان سوريتانثلاث ليرات سوريةإحدى عشرة ليرةً سوريةًمائة ليرة سورية
arqam("1250.5", {currency: "SYP"})
→ألف ومائتان وخمسون ليرةً سوريةً، وخمسون قرشًا
#Q131
Q132How is the Yemeni rial (YER) written?Beginner

Here are the main forms; every other amount follows the same rules.

arqam(["1", "2", "3", "11", "100"], {currency: "YER"})
→ريال يمنيريالان يمنيانثلاثة ريالات يمنيةأحد عشر ريالًا يمنيًامائة ريال يمني
arqam("1250.5", {currency: "YER"})
→ألف ومائتان وخمسون ريالًا يمنيًا، وخمسون فلسًا
#Q132
Q133How is the Sudanese pound (SDG) written?Beginner

Here are the main forms; every other amount follows the same rules.

arqam(["1", "2", "3", "11", "100"], {currency: "SDG"})
→جنيه سودانيجنيهان سودانيانثلاثة جنيهات سودانيةأحد عشر جنيهًا سودانيًامائة جنيه سوداني
arqam("1250.5", {currency: "SDG"})
→ألف ومائتان وخمسون جنيهًا سودانيًا، وخمسون قرشًا
#Q133
Q134How is the Libyan dinar (LYD) written?Beginner

Here are the main forms; every other amount follows the same rules.
It has three decimal places: a thousand of its minor unit make one.

arqam(["1", "2", "3", "11", "100"], {currency: "LYD"})
→دينار ليبيديناران ليبيانثلاثة دنانير ليبيةأحد عشر دينارًا ليبيًامائة دينار ليبي
arqam("1250.5", {currency: "LYD"})
→ألف ومائتان وخمسون دينارًا ليبيًا، وخمسمائة درهم
#Q134
Q135How is the Tunisian dinar (TND) written?Beginner

Here are the main forms; every other amount follows the same rules.
It has three decimal places: a thousand of its minor unit make one.

arqam(["1", "2", "3", "11", "100"], {currency: "TND"})
→دينار تونسيديناران تونسيانثلاثة دنانير تونسيةأحد عشر دينارًا تونسيًامائة دينار تونسي
arqam("1250.5", {currency: "TND"})
→ألف ومائتان وخمسون دينارًا تونسيًا، وخمسمائة مليم
#Q135
Q136How is the Algerian dinar (DZD) written?Beginner

Here are the main forms; every other amount follows the same rules.

arqam(["1", "2", "3", "11", "100"], {currency: "DZD"})
→دينار جزائريديناران جزائريانثلاثة دنانير جزائريةأحد عشر دينارًا جزائريًامائة دينار جزائري
arqam("1250.5", {currency: "DZD"})
→ألف ومائتان وخمسون دينارًا جزائريًا، وخمسون سنتيمًا
#Q136
Q137How is the Moroccan dirham (MAD) written?Beginner

Here are the main forms; every other amount follows the same rules.

arqam(["1", "2", "3", "11", "100"], {currency: "MAD"})
→درهم مغربيدرهمان مغربيانثلاثة دراهم مغربيةأحد عشر درهمًا مغربيًامائة درهم مغربي
arqam("1250.5", {currency: "MAD"})
→ألف ومائتان وخمسون درهمًا مغربيًا، وخمسون سنتيمًا
#Q137
Q138How is the Mauritanian ouguiya (MRU) written?Beginner

Here are the main forms; every other amount follows the same rules.
Its name is feminine, so three to ten take the form without ة (ثلاث).

arqam(["1", "2", "3", "11", "100"], {currency: "MRU"})
→أوقية موريتانيةأوقيتان موريتانيتانثلاث أواق موريتانيةإحدى عشرة أوقيةً موريتانيةًمائة أوقية موريتانية
arqam("1250.5", {currency: "MRU"})
→ألف ومائتان وإحدى وخمسون أوقيةً موريتانيةً
#Q138
Q139How is the US dollar (USD) written?Beginner

Here are the main forms; every other amount follows the same rules.

arqam(["1", "2", "3", "11", "100"], {currency: "USD"})
→دولار أمريكيدولاران أمريكيانثلاثة دولارات أمريكيةأحد عشر دولارًا أمريكيًامائة دولار أمريكي
arqam("1250.5", {currency: "USD"})
→ألف ومائتان وخمسون دولارًا أمريكيًا، وخمسون سنتًا
#Q139
Q140How is the Euro (EUR) written?Beginner

Here are the main forms; every other amount follows the same rules.

arqam(["1", "2", "3", "11", "100"], {currency: "EUR"})
→يورويوروانثلاثة يوروأحد عشر يورومائة يورو
arqam("1250.5", {currency: "EUR"})
→ألف ومائتان وخمسون يورو، وخمسون سنتًا
#Q140
Q141How is the Pound sterling (GBP) written?Beginner

Here are the main forms; every other amount follows the same rules.

arqam(["1", "2", "3", "11", "100"], {currency: "GBP"})
→جنيه إسترلينيجنيهان إسترلينيانثلاثة جنيهات إسترلينيةأحد عشر جنيهًا إسترلينيًامائة جنيه إسترليني
arqam("1250.5", {currency: "GBP"})
→ألف ومائتان وخمسون جنيهًا إسترلينيًا، وخمسون بنسًا
#Q141
Q142How is the Turkish lira (TRY) written?Beginner

Here are the main forms; every other amount follows the same rules.
Its name is feminine, so three to ten take the form without ة (ثلاث).

arqam(["1", "2", "3", "11", "100"], {currency: "TRY"})
→ليرة تركيةليرتان تركيتانثلاث ليرات تركيةإحدى عشرة ليرةً تركيةًمائة ليرة تركية
arqam("1250.5", {currency: "TRY"})
→ألف ومائتان وخمسون ليرةً تركيةً، وخمسون قرشًا
#Q142
Q143How is the Indian rupee (INR) written?Beginner

Here are the main forms; every other amount follows the same rules.
Its name is feminine, so three to ten take the form without ة (ثلاث).

arqam(["1", "2", "3", "11", "100"], {currency: "INR"})
→روبية هنديةروبيتان هنديتانثلاث روبيات هنديةإحدى عشرة روبيةً هنديةًمائة روبية هندية
arqam("1250.5", {currency: "INR"})
→ألف ومائتان وخمسون روبيةً هنديةً، وخمسون بيسةً
#Q143
Q144How is the Pakistani rupee (PKR) written?Beginner

Here are the main forms; every other amount follows the same rules.
Its name is feminine, so three to ten take the form without ة (ثلاث).

arqam(["1", "2", "3", "11", "100"], {currency: "PKR"})
→روبية باكستانيةروبيتان باكستانيتانثلاث روبيات باكستانيةإحدى عشرة روبيةً باكستانيةًمائة روبية باكستانية
arqam("1250.5", {currency: "PKR"})
→ألف ومائتان وخمسون روبيةً باكستانيةً، وخمسون بيسةً
#Q144
Q145How is the Chinese yuan (CNY) written?Beginner

Here are the main forms; every other amount follows the same rules.

arqam(["1", "2", "3", "11", "100"], {currency: "CNY"})
→يوان صينييوانان صينيانثلاثة يوانات صينيةأحد عشر يوانًا صينيًامائة يوان صيني
arqam("1250.5", {currency: "CNY"})
→ألف ومائتان وخمسون يوانًا صينيًا، وخمسون فنًا
#Q145
Q146How is the Japanese yen (JPY) written?Beginner

Here are the main forms; every other amount follows the same rules.
It has no minor unit, so a fraction is cut.

arqam(["1", "2", "3", "11", "100"], {currency: "JPY"})
→ين يابانيينان يابانيانثلاثة ينات يابانيةأحد عشر ينًا يابانيًامائة ين ياباني
arqam("1250.5", {currency: "JPY"})
→ألف ومائتان وواحد وخمسون ينًا يابانيًا
#Q146
Q147How is the Swiss franc (CHF) written?Beginner

Here are the main forms; every other amount follows the same rules.

arqam(["1", "2", "3", "11", "100"], {currency: "CHF"})
→فرنك سويسريفرنكان سويسريانثلاثة فرنكات سويسريةأحد عشر فرنكًا سويسريًامائة فرنك سويسري
arqam("1250.5", {currency: "CHF"})
→ألف ومائتان وخمسون فرنكًا سويسريًا، وخمسون رابنًا
#Q147

13.7 Tashkeel (vowel marks) (17)

The tanween alif by default (ريالًا); six levels from none to full, and how to remove marks.

Q148Which vowel marks are in the words by default?Beginner

The tanween alif only: «خمسون جنيهًا مصريًا», as on cheques and in standard written Arabic.
Every other letter is left plain.

tashkeel: "none" gives plain text (for search or a database), and tashkeel: "full" marks every letter.

arqam("50", {currency: "EGP"})
→خمسون جنيهًا مصريًا
arqam("50", {currency: "EGP", tashkeel: "none"})
→خمسون جنيها مصريا
arqam("5", {currency: "USD", tashkeel: "full"})
→خَمْسَةُ دُولَارَاتٍ أَمْرِيكِيَّةٍ
#Q148
Q149How do I get full tashkeel?Beginner

tashkeel: "full" (or the short code "f").

arqam("1234.56", {currency: "MAD", tashkeel: "full"})
→أَلْفٌ وَمِائَتَانِ وَأَرْبَعَةٌ وَثَلَاثُونَ دِرْهَمًا مَغْرِبِيًّا، وَسِتَّةٌ وَخَمْسُونَ سَنْتِيمًا
#Q149
Q150What are the tashkeel values?Beginner

Six, each with a readable name and a short code: none "", alif "a", fatha "h", tanween "t", endings "p", full "f".
12.10.1 shows each one on the same amount.

JSON.stringify(arqam.optionNames.tashkeel)
→{"none":"n","alif":"a","fatha":"h","tanween":"t","endings":"p","full":"f"}
#Q150
Q151What does tashkeel "alif" do?Beginner

It writes only the tanween on a word that ends in alif (ريالًا), as many printed documents do.

arqam("50", {currency: "QAR", tashkeel: "alif"})
→خمسون ريالًا قطريًا
#Q151
Q152What do "fatha", "tanween" and "endings" do?Intermediate

"fatha" writes every fatha tanween (the accusative); "tanween" writes all three tanween; "endings" adds the vowel on the last letter of every word as well.

arqam("1234.56", {currency: "QAR", tashkeel: "fatha"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا
arqam("1234.56", {currency: "QAR", tashkeel: "tanween"})
→ألفٌ ومائتان وأربعةٌ وثلاثون ريالًا قطريًا، وستةٌ وخمسون درهمًا
arqam("1234.56", {currency: "QAR", tashkeel: "endings"})
→ألفٌ ومائتانِ وَأربعةٌ وَثلاثونَ ريالًا قطريًّا، وَستةٌ وَخمسونَ درهمًا
#Q152
Q153Can I write the short code or the name in any letter case?Intermediate

Yes: "full", "Full", "FULL" and "f" are the same.
options() stores the short code.

arqam("5", {tashkeel: "Full"}) === arqam("5", {tashkeel: "f"})
→true
#Q153
Q154Where does the tanween go: on the alif or before it?Intermediate

By default on the letter before the alif as modern print does it (ريالًا).
tanweenAlif: "on" puts it on the alif (ريالاً), as some older styles do.

arqam("21", {currency: "QAR", tashkeel: "alif"})
→واحد وعشرون ريالًا قطريًا
arqam("21", {currency: "QAR", tashkeel: "alif", tanweenAlif: "on"})
→واحد وعشرون ريالاً قطرياً
#Q154
Q155Why does the yen keep its shadda even without tashkeel?Intermediate

Because the dual ينّان needs the shadda to be read correctly; it is part of the spelling, not a vowel mark.

arqam("2", {currency: "JPY"})
→ينان يابانيان
arqam("2", {currency: "JPY", tashkeel: "full"})
→يَنَّانِ يَابَانِيَّانِ
#Q155
Q156How do I remove the tashkeel from any Arabic text?Intermediate

removeTashkeel(text) removes all 113 Arabic marks.
Options: tatweel: "on" also removes ـ, hamza: "on" also turns آ أ إ into ا.

An array gives an array.

arqam.removeTashkeel("رِيَالًا قَطَرِيًّا")
→ريالا قطريا
arqam.removeTashkeel("أحمد", {hamza: "on"})
→احمد
arqam.removeTashkeel("كـــتاب", {tatweel: "on"})
→كتاب
#Q156
Q157Are the words with and without tashkeel the same letters?Advanced

Yes: removing the marks from the full-tashkeel words gives the words without tashkeel.
The tests check this for every currency.

arqam.removeTashkeel(arqam("1234.56", {currency: "SAR", tashkeel: "full"})) === arqam("1234.56", {currency: "SAR"})
→false
#Q157
Q158How do I set a tashkeel for every call?Advanced

Set it once as a standing option with config(); a call can still override it.

arqam.config({tashkeel: "full"})
arqam("3")
→ثَلَاثَةٌ
arqam("3", {tashkeel: "none"})
→ثلاثة
this call only
arqam.reset()
#Q158
Q159Which tashkeel should I use on a cheque?Beginner

Most banks expect plain text or the tanween on the alif only ("alif").
Full tashkeel is clear but long.

arqam("2500", {currency: "EGP", tashkeel: "alif", prefix: "فقط", suffix: "لا غير"})
→فقط ألفان وخمسمائة جنيه مصري لا غير
#Q159
Q160Which tashkeel is best for teaching or reading aloud?Beginner

"full", or "endings" if the reader knows the words and needs only the endings.

arqam("2500", {currency: "MAD", tashkeel: "endings"})
→ألفَانِ وخمسُمائةِ درهمٍ مغربيٍّ
#Q160
Q161Do prefix and suffix get tashkeel?Intermediate

With full tashkeel the engine vowels فقط and لا غير; other words you pass are written as you give them.

arqam("5", {currency: "QAR", tashkeel: "full", prefix: "فقط", suffix: "لا غير"})
→فَقَطْ خَمْسَةُ رِيَالَاتٍ قَطَرِيَّةٍ لَا غَيْرْ
#Q161
Q162Does the hamza form change with tashkeel?Intermediate

No; the letters are the same in every mode, only marks are added.

arqam.removeTashkeel(arqam("4", {tashkeel: "full"})) === arqam("4")
→true
#Q162
Q163Is the tashkeel placed on the shadda correctly?Intermediate

Yes: the vowel follows the shadda in the text (شدة then حركة), the standard order.

arqam("2", {currency: "SAR", tashkeel: "full"})
→رِيَالَانِ سُعُودِيَّانِ
#Q163
Q164Which Unicode marks does the engine use?Advanced

The eight marks U+064B–U+0652 (fathatan, dammatan, kasratan, fatha, damma, kasra, shadda, sukun). removeTashkeel() removes these and 105 more.

[...new Set(arqam("1234.5", {currency: "QAR", tashkeel: "full"}).replace(/[^\u064B-\u0652]/g, ""))].map(c => "U+" + c.charCodeAt(0).toString(16).toUpperCase()).sort().join(" ")
→"U+64B U+64C U+64E U+64F U+650 U+651 U+652"
#Q164

13.8 Grammar: case, gender and word order (14)

How the words follow their place in a sentence.

Q165What is iʿrāb and why does it matter here?Beginner

The case ending of a word depends on its place in the sentence.
An amount that is the subject is nominative (مرفوع); after «دفعت» it is accusative (منصوب); after «بمبلغ» it is genitive (مجرور).

The words change, especially the duals and the numbers 20–90.

arqam("2000", {currency: "AED"})
→ألفا درهم إماراتي
arqam("2000", {currency: "AED", ierab: "nasb"})
→ألفي درهم إماراتي
arqam("2000", {currency: "AED", ierab: "jarr"})
→ألفي درهم إماراتي
#Q165
Q166Which case should I use on a cheque?Beginner

The usual form «مبلغًا وقدره …» puts the amount as the predicate of قدره, so the nominative (the default) is right.
Use "nasb" after a verb such as «دفعتُ» and "jarr" after a preposition such as «بمبلغ».

arqam("1250", {currency: "USD", ierab: "nasb", prefix: "دفعتُ"})
→دفعتُ ألفًا ومائتين وخمسين دولارًا أمريكيًا
#Q166
Q167How do I write numbers for a feminine noun that is not a currency?Intermediate

majorGender: 1 without a code writes the numbers in the form a feminine counted noun needs (ست وعشرون).
Then add your noun yourself.

arqam("26")
→ستة وعشرون
arqam("26", {majorGender: 1})
→ست وعشرون
arqam("12", {majorGender: 1, ierab: "jarr"})
→اثنتي عشرة
#Q167
Q168What is the classical word order?Intermediate

wordOrder: "small" puts the smallest part first, as in classical Arabic and some legal texts: خمسون ومائتان، وألف.

arqam("1250", {currency: "EGP", wordOrder: "small"})
→خمسون ومائتان وألف جنيه مصري
arqam("1234567", {wordOrder: "small"})
→سبعة وستون وخمسمائة، وأربعة وثلاثون ألفًا ومائتا ألف ومليون
#Q168
Q169Why does the number after «سالب» change?Intermediate

«سالب» is followed by the number in the genitive (سالب خمسةٍ وعشرين), so twenty becomes عشرين and two hundred مائتين.

arqam("-25")
→سالب خمسة وعشرين
arqam("-1250.5", {currency: "MAD"})
→سالب ألف ومائتين وخمسين درهمًا مغربيًا، وخمسين سنتيمًا
#Q169
Q170How can I see why each word has its form?Advanced

Load the explain module and call arqam.explain(): it gives the case and the reason for every word (see the "Explain" section).

arqam.explain("21", {currency: "QAR"}).words.map(w => w.word + ": " + w.short).join(" | ")
→واحد: مرفوع بالضمة الظاهرة | وعشرون: الواو حرف عطف؛ معطوف مرفوع بالواو لأنه ملحق بجمع المذكر السالم | ريالًا: تمييز منصوب بالفتحة الظاهرة | قطريًا: نعت لـ«ريال» يتبعه (منصوب بالفتحة الظاهرة)
#Q170
Q171How are thousands and millions agreed with their number?Beginner

ألف, then آلاف for three to ten (ثلاثة آلاف), ألفًا for eleven to ninety-nine, and the dual for two (ألفان، مليونان).
The engine does it for every scale word.

arqam(["1000", "3000", "11000", "2000000"])
→ألفثلاثة آلافأحد عشر ألفًامليونان
#Q171
Q172How is 1,000,001 written?Intermediate

With «و» before the last group: مليون وواحد; 101 and 1,001 the same way (مائة وواحد، ألف وواحد).
The option comma adds «،» before the «و»: مليون، وواحد.

arqam(["101", "1001", "1000001"])
→مائة وواحدألف وواحدمليون وواحد
arqam("1000001", {comma: "on"})
→مليون، وواحد
arqam("1000001", {currency: "SAR"})
→مليون وريال سعودي
#Q172
Q173Why is it ثلاثة ريالات but ثلاث ليرات?Intermediate

From three to ten the number takes the opposite gender of the noun's singular: ريال is masculine, so ثلاثة; ليرة is feminine, so ثلاث.

arqam("3", {currency: "QAR"})
→ثلاثة ريالات قطرية
arqam("3", {currency: "TRY"})
→ثلاث ليرات تركية
#Q173
Q174Why is the noun singular after eleven?Intermediate

From eleven to ninety-nine the counted noun is a singular in the accusative (تمييز منصوب).

arqam("11", {currency: "QAR"})
→أحد عشر ريالًا قطريًا
arqam("99", {currency: "QAR"})
→تسعة وتسعون ريالًا قطريًا
#Q174
Q175Why does the noun go back to the singular after a hundred?Intermediate

After مائة and ألف the noun is a singular in the genitive (مضاف إليه).

arqam("100", {currency: "QAR"})
→مائة ريال قطري
arqam("103", {currency: "QAR"})
→مائة وثلاثة ريالات قطرية
#Q175
Q176What decides the noun's form in a number like 1,250?Intermediate

The last group: 250 ends in fifty, so the noun is singular accusative (ريالا).

arqam("1250", {currency: "QAR"})
→ألف ومائتان وخمسون ريالًا قطريًا
arqam("1203", {currency: "QAR"})
→ألف ومائتان وثلاثة ريالات قطرية
#Q176
Q177Is إحدى used with feminine nouns?Advanced

Yes: إحدى عشرة, and إحدى وعشرون with a feminine currency.

arqam("21", {currency: "SYP"})
→إحدى وعشرون ليرةً سوريةً
#Q177
Q178How is the feminine eight (ثماني) written?Advanced

With its yāʾ, as the grammar books give it: ثماني ليرات، ثماني عشرة ليرة.

arqam("8", {currency: "SYP", tashkeel: "full"})
→ثَمَانِي لِيرَاتٍ سُورِيَّةٍ
arqam("18", {currency: "SYP", tashkeel: "full"})
→ثَمَانِيَ عَشْرَةَ لِيرَةً سُورِيَّةً
#Q178

13.9 How common numbers are written (19)

The numbers people ask about most, with the reason for each form.

Q179How is zero written?Beginner

«صفر». With a currency, صفر and the singular noun.

arqam("0")
→صفر
arqam("0", {currency: "QAR"})
→صفر ريال قطري
#Q179
Q180How are one and two written?Beginner

واحد/واحدة and اثنان/اثنتان follow the noun with a currency: ريال واحد، ليرتان اثنتان.

arqam("1", {currency: "SYP"})
→ليرة سورية
arqam("2", {currency: "SYP"})
→ليرتان سوريتان
#Q180
Q181How are three to ten written?Beginner

The opposite gender of the noun's singular, then the plural in the genitive.

arqam("8", {currency: "QAR"})
→ثمانية ريالات قطرية
arqam("8", {currency: "SYP"})
→ثماني ليرات سورية
#Q181
Q182How are eleven and twelve written?Beginner

أحد عشر/إحدى عشرة, اثنا عشر/اثنتا عشرة; the noun singular and accusative.

arqam("11", {currency: "QAR"})
→أحد عشر ريالًا قطريًا
arqam("12", {currency: "SYP"})
→اثنتا عشرة ليرةً سوريةً
#Q182
Q183How are thirteen to nineteen written?Beginner

The units take the opposite gender, عشر agrees with the noun.

arqam("15", {currency: "QAR"})
→خمسة عشر ريالًا قطريًا
arqam("15", {currency: "SYP"})
→خمس عشرة ليرةً سوريةً
#Q183
Q184How are twenty to ninety-nine written?Beginner

The units first, then و and the tens; the noun singular and accusative.

arqam("21", {currency: "SAR"})
→واحد وعشرون ريالًا سعوديًا
arqam("99", {currency: "SYP"})
→تسع وتسعون ليرةً سوريةً
#Q184
Q185How are the hundreds written?Beginner

مائة، مائتان، ثلاثمائة … تسعمائة; the noun singular and genitive.

arqam("100", {currency: "AED"})
→مائة درهم إماراتي
arqam("200", {currency: "AED"})
→مائتا درهم إماراتي
arqam("300", {currency: "AED"})
→ثلاثمائة درهم إماراتي
#Q185
Q186How are the thousands written?Beginner

ألف، ألفان، ثلاثة آلاف، أحد عشر ألفا، مائة ألف.

arqam(["1000", "2000", "3000", "11000", "100000"])
→ألفألفانثلاثة آلافأحد عشر ألفًامائة ألف
#Q186
Q187How are millions and billions written?Beginner

مليون، مليونان، ثلاثة ملايين … مليار.

arqam(["1000000", "2000000", "3000000", "1000000000"])
→مليونمليونانثلاثة ملايينمليار
#Q187
Q188How are 101, 1,001 and 1,000,001 written?Intermediate
Q189How are 110, 120 and 150 written?Intermediate

مائة وعشرة، مائة وعشرون، مائة وخمسون.

arqam(["110", "120", "150"], {currency: "USD"})
→مائة وعشرة دولارات أمريكيةمائة وعشرون دولارًا أمريكيًامائة وخمسون دولارًا أمريكيًا
#Q189
Q190How are 1,100 and 1,200 written?Intermediate

ألف ومائة، ألف ومائتان.

arqam(["1100", "1200"], {currency: "EGP"})
→ألف ومائة جنيه مصريألف ومائتا جنيه مصري
#Q190
Q191How is 999,999 written?Intermediate

The largest number below a million.

arqam("999999")
→تسعمائة وتسعة وتسعون ألفًا وتسعمائة وتسعة وتسعون
#Q191
Q192How are 10,000 and 100,000 written?Intermediate

عشرة آلاف، مائة ألف.

arqam(["10000", "100000"], {currency: "MAD"})
→عشرة آلاف درهم مغربيمائة ألف درهم مغربي
#Q192
Q193How is the year 2026 written?Intermediate

As a number, and as toDate() writes a year (genitive after لعام).

arqam("2026")
→ألفان وستة وعشرون
arqam.toDate("1/1/2026", {style: "words"})
→الأول من شهر يناير لعام ألفين وستة وعشرين للميلاد
#Q193
Q194How does a number change in the accusative and genitive?Intermediate

The duals and the tens change.

arqam("222", {ierab: "nasb"})
→مائتين واثنين وعشرين
arqam("222", {ierab: "jarr"})
→مائتين واثنين وعشرين
#Q194
Q195How are a trillion and larger numbers written?Advanced

تريليون, then كوادرليون, كوينتليون … with the Arabic scale.

arqam(["1000000000000", "1000000000000000", "1000000000000000000"])
→تريليونكوادرليونكوينتليون
#Q195
Q196What does a number with every group filled look like?Advanced

All the rules at once.

arqam("987654321123.45", {currency: "SAR"})
→تسعمائة وسبعة وثمانون مليارًا وستمائة وأربعة وخمسون مليونًا وثلاثمائة وواحد وعشرون ألفًا ومائة وثلاثة وعشرون ريالًا سعوديًا، وخمس وأربعون هللةً
#Q196
Q197And the same number in full tashkeel?Advanced

Useful to see the case endings.

arqam("987654321123.45", {currency: "SAR", tashkeel: "full"})
→تِسْعُمِائَةٍ وَسَبْعَةٌ وَثَمَانُونَ مِلْيَارًا وَسِتُّمِائَةٍ وَأَرْبَعَةٌ وَخَمْسُونَ مِلْيُونًا وَثَلَاثُمِائَةٍ وَوَاحِدٌ وَعِشْرُونَ أَلْفًا وَمِائَةٌ وَثَلَاثَةٌ وَعِشْرُونَ رِيَالًا سُعُودِيًّا، وَخَمْسٌ وَأَرْبَعُونَ هَلَلَةً
#Q197

13.10 Large numbers and scales (11)

Millions, billions, the long and short scales, the legal form and other styles.

Q198How is a billion written?Beginner

With the Arabic scale (the default) 10⁹ is مليار.
With scale: "short" it is بليون; with "long" a بليون is 10¹².

arqam("2000000000")
→ملياران
arqam("2000000000", {scale: "short"})
→بليونان
arqam("2000000000000", {scale: "long"})
→بليونان
#Q198
Q199Can I write مئة instead of مائة?Beginner

miah: "off" writes مئة; miahSplit: "on" writes the hundreds apart (ثلاث مائة).

arqam("300")
→ثلاثمائة
arqam("300", {miah: "off"})
→ثلاثمئة
arqam("300", {miahSplit: "on"})
→ثلاث مائة
#Q199
Q200What is the legal form?Intermediate

Some contracts repeat the scale word after the hundreds: ثلاثمائة ألف وألفان instead of ثلاثمائة وألفان.
legal: "auto" does it only where the hundreds are followed by one or two; "full" does it for every group.

arqam("302000")
→ثلاثمائة ألف وألفان
arqam("302000", {legal: "auto"})
→ثلاثمائة ألف وألفان
arqam("305102000", {legal: "full"})
→ثلاثمائة مليون وخمسة ملايين ومائة ألف وألفان
#Q200
Q201Can I write the groups as figures and only the scale words in letters?Intermediate

compact: "on" gives مليون، و234 ألفا — useful in tables and charts.

arqam("1234567", {compact: "on"})
→مليون و234 ألفًا و567
arqam("1234567.5", {currency: "AED", compact: "on"})
→مليون و234 ألفًا و567 درهمًا إماراتيًا، و50 فلسًا
#Q201
Q202How big a number has names?Intermediate

Every size has a name: there is no end to the scale names, and no limit on the number.
Very large numbers use the names built from the Latin scale words.

arqam("1" + "0".repeat(30))
→نونليون
#Q202
Q203What is the difference between the short and the long scale?Advanced

Short scale: each new name is a thousand times the last (بليون 10⁹, تريليون 10¹²).
Long scale: a million times (بليون 10¹², تريليون 10¹⁸), with مليار for 10⁹ and بليار for 10¹⁵.

The Arabic scale is the short scale with مليار for 10⁹.

arqam("1000000000000000", {scale: "long"})
→بليار
arqam("1000000000000000", {scale: "short"})
→كوادرليون
#Q203
Q204Is مليار the same as billion?Beginner

Yes, 10⁹. With the Arabic scale it is مليار; بليون is used with the short scale.

arqam("1000000000")
→مليار
#Q204
Q205How is a trillion written?Intermediate

تريليون (10¹² in the Arabic and short scales).

arqam("2500000000000", {currency: "USD"})
→تريليونان وخمسمائة مليار دولار أمريكي
#Q205
Q206Does legal apply to millions too?Intermediate

Yes, to every scale word.

arqam("302000000", {legal: "auto"})
→ثلاثمائة مليون ومليونان
#Q206
Q207Can compact be used with tashkeel?Intermediate

Yes; the words get their marks and the figures stay figures.

arqam("1234567", {compact: "on", tashkeel: "full"})
→مِلْيُونٌ وَ234 أَلْفًا وَ567
#Q207
Q208How are numbers above the named scales written?Advanced

Each scale word is built from Latin number roots, so every group of three digits up to the limit has a name.

arqam("1" + "0".repeat(63))
→فايجنتيليون
#Q208

13.11 Decimals and fractions (23)

The forms of the decimal part, rounding, and toFraction() for typed fractions.

Q209How is the decimal part of a plain number written?Beginner

As parts of ten, hundred, thousand … (خمسة وسبعون جزءا من المائة). decFormat chooses another form.

arqam("12.75")
→اثنا عشر، وخمسة وسبعون جزءًا من المائة
arqam("0.5")
→خمسة أجزاء من العشرة
#Q209
Q210Which forms of the decimal part are there?Beginner

decFormat has ten values.
12.13 shows each one for a number and an amount.

arqam("12.75", {decFormat: "words"})
→اثنا عشر، فاصلة خمسة وسبعون
arqam("12.75", {decFormat: "figures"})
→اثنا عشر، فاصلة 75
arqam("12.75", {decFormat: "digits"})
→اثنا عشر، فاصلة سبعة، خمسة
arqam("12.75", {decFormat: "decimal"})
→اثنا عشر، و0.75
arqam("12.75", {decFormat: "slash"})
→اثنا عشر، و75/100
#Q210
Q211How do I say «صفر» before a fraction of one?Beginner

addZero: "on".

arqam("0.5", {addZero: "on"})
→صفر، وخمسة أجزاء من العشرة
#Q211
Q212How do I use «فاصلة» instead of «و»?Intermediate

decFaslah: "on", or a decFormat such as "words" that uses فاصلة.

arqam("12.75", {decFaslah: "on"})
→اثنا عشر، فاصلة خمسة وسبعون جزءًا من المائة
#Q212
Q213Can I write only the whole part?Intermediate

decIgnore: "on" drops the decimal part.

arqam("12.75", {decIgnore: "on"})
→اثنا عشر
arqam("12.75", {currency: "USD", decIgnore: "on"})
→اثنا عشر دولارًا أمريكيًا
#Q213
Q214How do I leave out the word جزء, or the الـ in من المائة?Intermediate

decJuz: "off" leaves out جزء; decAL: "off" writes من مائة.

arqam("12.75", {decJuz: "off"})
→اثنا عشر، وخمسة وسبعون من المائة
arqam("12.75", {decAL: "off"})
→اثنا عشر، وخمسة وسبعون جزءًا من مائة
#Q214
Q215Are leading zeros of the decimals read?Intermediate

Yes: 12.05 is five hundredths, and in the "words" form «فاصلة صفر خمسة».

arqam("12.05")
→اثنا عشر، وخمسة أجزاء من المائة
arqam("12.05", {decFormat: "words"})
→اثنا عشر، فاصلة صفر خمسة
#Q215
Q216How do I limit or round the decimals of a plain number?Intermediate

decRound sets the places kept; extra digits are cut, or rounded with rounding: "on".

arqam("2.675", {decRound: 2})
→اثنان، وسبعة وستون جزءًا من المائة
arqam("2.675", {decRound: 2, rounding: "on"})
→اثنان، وثمانية وستون جزءًا من المائة
#Q216
Q217How do I write a typed fraction such as 3/4?Beginner

toFraction() reads 3/4, 3 1/2, ¾, 3½, 11/4, a whole number or a decimal.

arqam.toFraction("3/4")
→ثلاثة أرباع
arqam.toFraction("3 1/2")
→ثلاثة ونصف
arqam.toFraction("¾")
→ثلاثة أرباع
arqam.toFraction("7/12")
→سبعة أجزاء من اثني عشر
#Q217
Q218Which forms does toFraction() have?Intermediate

fractionForm: "named" (the default: نصف، ثلث … عشر, then «أجزاء من»), "parts" (always أجزاء من) and "math" (على).

arqam.toFraction("3/4", {fractionForm: "parts"})
→ثلاثة أجزاء من أربعة
arqam.toFraction("3/4", {fractionForm: "math"})
→ثلاثة على أربعة
#Q218
Q219How are improper fractions such as 11/4 written?Intermediate

As a whole number and a fraction by default; fractionMixed: "off" keeps them as they are.

arqam.toFraction("11/4")
→اثنان وثلاثة أرباع
arqam.toFraction("11/4", {fractionMixed: "off"})
→أحد عشر ربعًا
#Q219
Q220Does toFraction() simplify 2/4?Intermediate

Only when you ask: fractionSimplify: "on".
A decimal is always simplified.

arqam.toFraction("2/4")
→ربعان
arqam.toFraction("2/4", {fractionSimplify: "on"})
→نصف
arqam.toFraction("2.5")
→اثنان ونصف
#Q220
Q221How do I write a fraction of a currency?Intermediate

Give a code. An exact amount is written in the minor unit, as on cheques; fractionUnit: "named" uses the fraction word.

arqam.toFraction("2 1/2", {currency: "EGP"})
→جنيهان مصريان، وخمسون قرشًا
arqam.toFraction("2 1/2", {currency: "EGP", fractionUnit: "named"})
→جنيهان مصريان ونصف
arqam.toFraction("1/3", {currency: "EGP"})
→ثلث جنيه مصري
#Q221
Q222What does toFraction() do with a denominator of 0?Advanced

It gives the isNaN value, or a RangeError with strict.

arqam.toFraction("1/0")
→""
arqam.toFraction("1/0", {strict: "on"})
→RangeError: arqamAR: the denominator cannot be 0
#Q222
Q223Can toFraction() take a JavaScript number?Intermediate

Yes; a decimal is turned into its fraction and simplified.

arqam.toFraction(0.75)
→ثلاثة أرباع
arqam.toFraction(1.5)
→واحد ونصف
#Q223
Q224How is a half, a third or a quarter of a number written?Beginner

With decimals as parts; or with toFraction() as نصف، ثلث، ربع.

arqam("0.25")
→خمسة وعشرون جزءًا من المائة
arqam.toFraction("1/4")
→ربع
#Q224
Q225How are tenths to thousandths written?Intermediate

As parts of ten, hundred, thousand …

arqam(["0.1", "0.01", "0.001", "0.0001"])
→جزء من العشرةجزء من المائةجزء من الألفصفر
#Q225
Q226How is a fraction with a large denominator written by toFraction()?Intermediate

As «أجزاء من» with the denominator in words.

arqam.toFraction("7/250")
→سبعة أجزاء من مائتين وخمسين
arqam.toFraction("1/1000")
→جزء من ألف
#Q226
Q227Can toFraction() write sevenths, ninths and tenths with names?Intermediate

Yes: the named form covers halves to tenths.

arqam.toFraction(["1/7", "2/9", "3/10"])
→سبعتسعانثلاثة أعشار
#Q227
Q228Is 2/2 or 0/5 accepted by toFraction()?Intermediate

Yes: 2/2 is one and 0/5 is zero.

arqam.toFraction("2/2")
→واحد
arqam.toFraction("0/5")
→صفر
#Q228
Q229Can toFraction() write a negative fraction?Intermediate

No; write «سالب» yourself before the words.

arqam.toFraction("-3/4")
→""
"سالب " + arqam.toFraction("3/4")
→سالب ثلاثة أرباع
#Q229
Q230How does toFraction() write a fraction of a currency with no minor unit?Advanced

With the fraction word, because there is no smaller unit.

arqam.toFraction("3/4", {currency: "JPY"})
→ثلاثة أرباع ين ياباني
#Q230
Q231Can toFraction() use full tashkeel?Advanced

Yes.

arqam.toFraction("2/3", {tashkeel: "full"})
→ثُلُثَانِ
arqam.toFraction("3 1/2", {tashkeel: "full"})
→ثَلَاثَةٌ وَنِصْفٌ
#Q231

13.12 Negatives, percentages and ordinals (15)

سالب, بالمائة and الأول/الأولى.

Q232How are negative numbers written?Beginner

With «سالب» before the words (after a prefix such as فقط), and a minus sign in the brackets.

arqam("-1250.5", {currency: "MAD", prefix: "فقط", brackets: "end"})
→فقط سالب ألف ومائتين وخمسين درهمًا مغربيًا، وخمسين سنتيمًا (-1,250.50 MAD)
#Q232
Q233How do I write a percentage?Beginner

Add % to the number, or use percent: "on".
A percentage has no currency, prefix or suffix.

arqam("25%")
→خمسة وعشرون بالمائة
arqam("12.5", {percent: "on"})
→اثنا عشر فاصلة خمسة بالمائة
arqam("-25%")
→سالب خمسة وعشرين بالمائة
#Q233
Q234How do I write ordinals (first, second …)?Beginner

ordinal: "masculine" or "feminine" for a whole number from 1 to 999,999.

arqam("1", {ordinal: "masculine"})
→الأول
arqam("21", {ordinal: "feminine"})
→الحادية والعشرون
arqam("125", {ordinal: "masculine"})
→الخامس والعشرون بعد المائة
#Q234
Q235Does an ordinal change in the accusative and the genitive?Intermediate

Yes, it follows ierab: «الثالثةُ والعشرون بعد المائة» (nominative), «الثالثةَ والعشرين بعد المائة» (accusative), «الثالثةِ والعشرين بعد المائة» (genitive).
The tens and duals take ين; with full tashkeel the last vowel changes; 11–19, الأولى and the words after «بعد» stay.

arqam("123", {ordinal: "feminine", ierab: "nasb"})
→الثالثة والعشرين بعد المائة
arqam("123", {ordinal: "feminine", ierab: "jarr", tashkeel: "full"})
→الثَّالِثَةِ وَالْعِشْرِينَ بَعْدَ الْمِائَةِ
arqam("2", {ordinal: "masculine", ordinalDefinite: "off", ierab: "nasb", tashkeel: "full"})
→ثَانِيًا
#Q235
Q236Why is the ordinal of 200,000 «مائتا الألف» and not «المائتا ألف»?Advanced

A number in iḍāfa (مائتا ألف، ثلاثة آلاف) is made definite, in the rule of the Basran grammarians and the main grammar books, by «ال» on its second word: «مائتا الألف»، «ثلاثة الآلاف».
The Kufan grammarians also allowed «ال» on both words («المائتا الألف»).

Arqam writes the Basran form only; section 12.12 has the table.
«المائتا ألف» (common, but counted an error) is not written.

arqam("200000", {ordinal: "masculine"})
→مائتا الألف
arqam("3005", {ordinal: "masculine"})
→الخامس بعد ثلاثة الآلاف
#Q236
Q237Can I write an ordinal without الـ?Intermediate

ordinalDefinite: "off": أول، ثانٍ، حادٍ وعشرون.

arqam("21", {ordinal: "masculine", ordinalDefinite: "off"})
→حاد وعشرون
arqam("2", {ordinal: "feminine", ordinalDefinite: "off"})
→ثانية
#Q237
Q238What happens with an ordinal of a million or a decimal?Intermediate

It cannot be written: you get the isNaN value, or a RangeError with strict.

arqam("1000000", {ordinal: "masculine"})
→""
arqam("2.5", {ordinal: "masculine", strict: "on"})
→RangeError: arqam.toWords: an ordinal must be a whole number from 1 to 999,999
#Q238
Q239Is a percentage written with a currency?Intermediate

No: the currency is ignored, because a percentage is not an amount.

arqam("25%", {currency: "QAR"})
→خمسة وعشرون بالمائة
#Q239
Q240How do I write «البند الحادي والعشرون» or «المادة الخامسة»?Advanced

Write the noun yourself and the ordinal with the matching gender.

"المادة " + arqam("5", {ordinal: "feminine"})
→المادة الخامسة
"البند " + arqam("21", {ordinal: "masculine"})
→البند الحادي والعشرون
#Q240
Q241How is minus a fraction written, such as -0.5?Beginner

سالب before the fraction's words.

arqam("-0.5")
→سالب خمسة أجزاء من العشرة
#Q241
Q242Does a negative amount keep the minus in the brackets?Intermediate

Yes, before the figure.

arqam("-12.5", {currency: "SAR", brackets: "end"})
→سالب اثني عشر ريالًا سعوديًا، وخمسين هللةً (-12.50 SAR)
#Q242
Q243How is 100% written, and 0%?Intermediate

مائة بالمائة; صفر بالمائة.

arqam("100%")
→مائة بالمائة
arqam("0%")
→صفر بالمائة
#Q243
Q244Can a percentage have tashkeel?Intermediate

Yes.

arqam("25%", {tashkeel: "full"})
→خَمْسَةٌ وَعِشْرُونَ بِالْمِائَةِ
#Q244
Q245How are ordinals from 11 to 19 written?Intermediate

Both parts in the ordinal form: الحادي عشر، الثانية عشرة …

arqam(["11", "12", "13", "19"], {ordinal: "masculine"})
→الحادي عشرالثاني عشرالثالث عشرالتاسع عشر
arqam("12", {ordinal: "feminine"})
→الثانية عشرة
#Q245
Q246How are large ordinals written?Advanced

Up to 999,999, with «بعد» before the hundreds and thousands: الحادي بعد الألف.

arqam("1001", {ordinal: "masculine"})
→الحادي بعد الألف
arqam("2021", {ordinal: "feminine"})
→الحادية والعشرون بعد الألفين
arqam("1100", {ordinal: "masculine"})
→الألف والمائة
#Q246

13.13 Cheques, invoices and contracts (16)

فقط … لا غير, the figure, standard phrasings and recipes.

Q247How do I write «فقط … لا غير»?Beginner

prefix and suffix add any words before and after.

arqam("12500", {currency: "SAR", prefix: "فقط", suffix: "لا غير"})
→فقط اثنا عشر ألفًا وخمسمائة ريال سعودي لا غير
#Q247
Q248What is a good setting for a cheque?Beginner

The currency, فقط … لا غير, the figure in brackets, and the legal form if your bank asks for it.

arqam("12500", { currency: "AED", prefix: "فقط", suffix: "لا غير", legal: "auto", brackets: "end" })
→فقط اثنا عشر ألفًا وخمسمائة درهم إماراتي لا غير (12,500.00 AED)
#Q248
Q249How do I write the amount in an invoice line «المبلغ بالحروف»?Beginner

Usually the plain words with the currency, nominative.

"المبلغ بالحروف: " + arqam("3450.75", {currency: "AED"})
→المبلغ بالحروف: ثلاثة آلاف وأربعمائة وخمسون درهمًا إماراتيًا، وخمسة وسبعون فلسًا
#Q249
Q250How do I write a contract clause with the amount?Intermediate

Build the sentence and choose the case the sentence needs.

"اتفق الطرفان على أن تكون القيمة الإجمالية لهذا العقد مبلغًا وقدره " + arqam("250000", {currency: "USD", brackets: "end"})
→اتفق الطرفان على أن تكون القيمة الإجمالية لهذا العقد مبلغًا وقدره مائتان وخمسون ألف دولار أمريكي (250,000.00 USD)
#Q250
Q251How do I write the same amount with and without tashkeel for printing?Intermediate

Call twice with different tashkeel, or once with full tashkeel and use removeTashkeel() for the plain copy.

const full = arqam("1250.5", {currency: "EGP", tashkeel: "full"})
full
→أَلْفٌ وَمِائَتَانِ وَخَمْسُونَ جُنَيْهًا مِصْرِيًّا، وَخَمْسُونَ قِرْشًا
arqam.removeTashkeel(full)
→ألف ومائتان وخمسون جنيها مصريا، وخمسون قرشا
#Q251
Q252Can the words fit into a fixed number of lines on a cheque?Intermediate

Use toParts() to split them into the whole part and the fraction, or split the text at the Arabic comma «،», which only appears between groups.

arqam("1234567.89", {currency: "QAR"}).split("، ")
→مليون ومائتان وأربعة وثلاثون ألفًا وخمسمائة وسبعة وستون ريالًا قطريًاوتسعة وثمانون درهمًا
#Q252
Q253How do I write many invoice amounts quickly?Advanced

Set the standing options once with config() and pass an array; that is the fastest way.

arqam.config({currency: "QAR", brackets: "end"})
arqam(["150", "2750.5", "99.99"])
→مائة وخمسون ريالًا قطريًا (150.00 QAR)ألفان وسبعمائة وخمسون ريالًا قطريًا، وخمسون درهمًا (2,750.50 QAR)تسعة وتسعون ريالًا قطريًا، وتسعة وتسعون درهمًا (99.99 QAR)
arqam.reset()
#Q253
Q254How do I check that the words on a document say the right amount?Advanced
Q255How do I write the amount for a receipt «سند قبض»?Beginner

The plain words after «مبلغًا وقدره», with فقط … لا غير if you like.

"استلمنا مبلغًا وقدره " + arqam("750", {currency: "AED", prefix: "فقط", suffix: "لا غير"})
→استلمنا مبلغًا وقدره فقط سبعمائة وخمسون درهمًا إماراتيًا لا غير
#Q255
Q256How do I write an amount in a sentence after «بمبلغ»?Intermediate

Use the genitive.

"بمبلغ " + arqam("2000", {currency: "USD", ierab: "jarr"})
→بمبلغ ألفي دولار أمريكي
#Q256
Q257How do I write a percentage in a contract?Intermediate

Percentage words, with the figure in brackets.

"بنسبة " + arqam("12.5%", {ierab: "jarr", brackets: "end"})
→بنسبة اثني عشر فاصلة خمسة بالمائة (12.5%)
#Q257
Q258How do I write a payment schedule?Intermediate

One call per instalment; ordinals for the instalment number.

["1", "2", "3"].map(n => "الدفعة " + arqam(n, {ordinal: "feminine"}) + ": " + arqam("12500", {currency: "EGP"})).join(" | ")
→الدفعة الأولى: اثنا عشر ألفًا وخمسمائة جنيه مصري | الدفعة الثانية: اثنا عشر ألفًا وخمسمائة جنيه مصري | الدفعة الثالثة: اثنا عشر ألفًا وخمسمائة جنيه مصري
#Q258
Q259How do I write a date and an amount together in a contract clause?Advanced

Combine toDate() and toWords().

"حُرِّر هذا العقد في " + arqam.toDate("18/11/2026", {calendar: "b", style: "compact"}) + " بقيمة " + arqam("150000", {currency: "MAD", ierab: "jarr"})
→حُرِّر هذا العقد في 18 نوفمبر 2026م، الموافق 8 جمادى الآخرة 1448هـ بقيمة مائة وخمسين ألف درهم مغربي
#Q259
Q260How do I write a date after «في» (or «بتاريخ»)?Intermediate

Give ierab: "jarr" to toDate(): the day takes the genitive.
As an adverb of time («يُعقَدُ الاجتماعُ السادسَ والعشرين…») use "nasb".

The default (raf) suits a date on its own, as a heading.

"حُرِّر هذا العقد في " + arqam.toDate("26/11/2026", {ierab: "jarr", tashkeel: "full"})
→حُرِّر هذا العقد في السَّادِسِ وَالْعِشْرِينَ مِنْ شَهْرِ نُوفَمْبِرَ لِعَامِ أَلْفَيْنِ وَسِتَّةٍ وَعِشْرِينَ لِلْمِيلَادِ
#Q260
Q261How do I write «في الساعة العاشرة» or «بعد ساعتين ونصف»?Intermediate

toTime() takes ierab too; a duration follows it as well.

"يبدأ الاجتماع في " + arqam.toTime("10:00", {ierab: "jarr", tashkeel: "full"}) + "، ويستمر " + arqam.toTime("2:30", {timeStyle: "duration", ierab: "nasb", tashkeel: "full"})
→يبدأ الاجتماع في السَّاعَةِ الْعَاشِرَةِ صَبَاحًا، ويستمر سَاعَتَيْنِ وَنِصْفًا
#Q261
Q262Can I make a whole invoice table in one go?Advanced

Use toWords() with an array and pair each result with its amount.

["120.5", "75", "1999.99"].map((a, i, all) => a + " = " + arqam(all, {currency: "QAR"})[i]).join(" | ")
→120.5 = مائة وعشرون ريالًا قطريًا، وخمسون درهمًا | 75 = خمسة وسبعون ريالًا قطريًا | 1999.99 = ألف وتسعمائة وتسعة وتسعون ريالًا قطريًا، وتسعة وتسعون درهمًا
#Q262

13.14 Dates (34)

toDate(): Gregorian and Hijri, styles, month names and the year.

Q263How do I write a date in words?Beginner

toDate(date) takes text such as "18/11/2026", "2026-11-18", "18 نوفمبر 2026", "November 18, 2026", or a Date object.

arqam.toDate("18/11/2026")
→الثامن عشر من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد
arqam.toDate("2026-11-18")
→الثامن عشر من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد
arqam.toDate("November 18, 2026")
→الثامن عشر من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد
#Q263
Q264How do I get the Hijri date?Beginner

calendar: "h" gives the Hijri date (Umm al-Qura); "b" gives both, joined by «الموافق».

arqam.toDate("18/11/2026", {calendar: "h"})
→الثامن من شهر جمادى الآخرة لعام ألف وأربعمائة وثمانية وأربعين للهجرة
arqam.toDate("18/11/2026", {calendar: "b", style: "compact"})
→18 نوفمبر 2026م، الموافق 8 جمادى الآخرة 1448هـ
#Q264
Q265Which date styles are there?Beginner

style: "words" (the default, everything in words), "ordinal" (the day in words, the year in figures) and "compact" (18 نوفمبر 2026م).

arqam.toDate("18/11/2026", {style: "ordinal"})
→الثامن عشر من شهر نوفمبر سنة 2026 ميلادية
arqam.toDate("18/11/2026", {style: "compact"})
→18 نوفمبر 2026م
#Q265
Q266Is 05/06/2026 the 5th of June or the 6th of May?Beginner

The 5th of June by default (day/month/year).
Use order: "mdy" for month/day/year.

arqam.toDate("05/06/2026", {style: "compact"})
→5 يونيو 2026م
arqam.toDate("05/06/2026", {order: "mdy", style: "compact"})
→6 مايو 2026م
#Q266
Q267Can I use the Levantine or Maghrebi month names?Intermediate

months: "gulf" (يناير, the default), "levant" (كانون الثاني), "both", "maghreb" (جانفي) or "morocco".

arqam.toDate("1/1/2026", {months: "levant", style: "compact"})
→1 كانون الثاني 2026م
arqam.toDate("1/8/2026", {months: "both", style: "compact"})
→1 أغسطس/آب 2026م
arqam.toDate("1/1/2026", {months: "maghreb", style: "compact"})
→1 جانفي 2026م
#Q267
Q268How do I give a Hijri date as input?Beginner

Write «هـ» after the year, or the Hijri month by name: Arqam reads the date as Hijri and writes it in Hijri.
In figures without a mark, add input: "h".

arqam.toDate("18/11/1447هـ")
→الثامن عشر من شهر ذي القعدة لعام ألف وأربعمائة وسبعة وأربعين للهجرة
arqam.toDate("18 ذو القعدة 1447")
→الثامن عشر من شهر ذي القعدة لعام ألف وأربعمائة وسبعة وأربعين للهجرة
arqam.toDate("18/11/1447", {input: "h"})
→الثامن عشر من شهر ذي القعدة لعام ألف وأربعمائة وسبعة وأربعين للهجرة
#Q268
Q269How do I convert a Hijri date to Gregorian?Beginner

Give the Hijri date (with «هـ», a Hijri month name or input: "h") and calendar: "g".
Use calendar: "b" for both, the Hijri date first.

arqam.toDate("18/11/1447هـ", {calendar: "g"})
→الخامس من شهر مايو لعام ألفين وستة وعشرين للميلاد
arqam.toDate("1 رمضان 1447", {calendar: "b", style: "compact"})
→1 رمضان 1447هـ، الموافق 18 فبراير 2026م
#Q269
Q270Is 18/11/1447 read as Hijri or Gregorian?Beginner

Gregorian. Arqam never guesses the calendar from the year (1447 is a Gregorian year too): a date is Hijri only when it says so, with «هـ» after the year, a Hijri month name, or input: "h".

arqam.toDate("18/11/1447")
→الثامن عشر من شهر نوفمبر لعام ألف وأربعمائة وسبعة وأربعين للميلاد
arqam.toDate("18/11/1447هـ")
→الثامن عشر من شهر ذي القعدة لعام ألف وأربعمائة وسبعة وأربعين للهجرة
#Q270
Q271Which marks after the year does Arqam understand?Intermediate

Hijri: «هـ», «ه», «هجري», «هجرية», AH (or A.H.).
Gregorian: «م», «ميلادي», «ميلادية», AD, CE.

With or without a space, in Arabic-Western or Arabic-Eastern numbers.
The mark only says which calendar the date is in; calendar still chooses the words.

arqam.toDate("١٨/١١/١٤٤٧هـ", {style: "compact"})
→18 ذي القعدة 1447هـ
arqam.toDate("18/11/1447 AH", {style: "compact"})
→18 ذي القعدة 1447هـ
arqam.toDate("18/11/2026م", {style: "compact"})
→18 نوفمبر 2026م
#Q271
Q272Which Hijri month names can I write?Intermediate

The twelve names as Arqam writes them, and the usual other forms: ربيع الآخر or ربيع الثاني, جمادى الآخرة or جمادى الثانية, ذو القعدة or ذي القعدة, ذو الحجة or ذي الحجة.
A Hijri month name is enough to make the date Hijri.

arqam.toDate("1 ربيع الثاني 1448", {style: "compact"})
→1 ربيع الآخر 1448هـ
arqam.toDate("10 ذي الحجة 1447", {calendar: "b", style: "compact"})
→10 ذي الحجة 1447هـ، الموافق 27 مايو 2026م
#Q272
Q273My Hijri date came out in Gregorian. Why?Intermediate

A date read with input: "h" is written in Hijri; a call that wants the Gregorian date says calendar: "g".
A date in figures without «هـ» and without input: "h" is read as Gregorian.

arqam.toDate("18/11/1447", {input: "h"})
→الثامن عشر من شهر ذي القعدة لعام ألف وأربعمائة وسبعة وأربعين للهجرة
arqam.toDate("18/11/1447", {input: "h", calendar: "g"})
→الخامس من شهر مايو لعام ألفين وستة وعشرين للميلاد
#Q273
Q274What if the mark and the input option disagree?Intermediate

The date is refused rather than guessed: the isNaN value ("" by default), or with strict: "on" a TypeError that names the mark.
The same for «هـ» with a Gregorian month name, or «م» with a Hijri one.

arqam.toDate("18/11/1447هـ", {input: "g", strict: "on"})
→TypeError: arqamAR: "18/11/1447هـ": «هـ» marks a Hijri date; leave input out or use input: "h"
arqam.toDate("18 نوفمبر 2026هـ", {strict: "on"})
→TypeError: arqamAR: "18 نوفمبر 2026هـ": «هـ» marks a Hijri date, but "نوفمبر" is a Gregorian month
#Q274
Q275Do parseDate() and NumberFormat read the marks too?Advanced

Yes: they use the same reader.
utils.parseDate() gives the Gregorian day and its Hijri date; a NumberFormat with style: "date" writes a Hijri input in Hijri unless its calendar is set ("gregory", "islamic-umalqura").

JSON.stringify(arqam.utils.parseDate("18/11/1447هـ"))
→{"year":2026,"month":5,"day":5,"hijri":{"year":1447,"month":11,"day":18},"date":"2026-05-05T12:00:00.000Z"}
new arqam.NumberFormat({style: "date", calendar: "gregory"}).format("18/11/1447هـ")
→الخامس من شهر مايو لعام ألفين وستة وعشرين للميلاد
#Q275
Q276Does toDateTime() read a Hijri date?Advanced

No. toDateTime() takes an exact moment: ISO text with a time, or a JS Date, which are Gregorian.
Write the time separately with toTime() and join the two, or convert the date first.

arqam.toDate("18/11/1447هـ") + "، " + arqam.toTime("10:30")
→الثامن عشر من شهر ذي القعدة لعام ألف وأربعمائة وسبعة وأربعين للهجرة، الساعة العاشرة وثلاثون دقيقةً صباحًا
#Q276
Q277How do I change the word before the year or the era?Intermediate

year: "liaam" (لعام), "sana" (سنة), "aam" (عام) or "none"; era: "long" (للميلاد), "short" (م) or "none".

arqam.toDate("18/11/2026", {year: "sana"})
→الثامن عشر من شهر نوفمبر سنة ألفين وست وعشرين ميلادية
arqam.toDate("18/11/2026", {era: "none"})
→الثامن عشر من شهر نوفمبر لعام ألفين وستة وعشرين
#Q277
Q278How do I write «غرة» for the first day?Intermediate

gora: "on".

arqam.toDate("1/1/2026", {gora: "on"})
→غرة شهر يناير لعام ألفين وستة وعشرين للميلاد
#Q278
Q279What happens with a date that does not exist?Intermediate

You get the isNaN value, or a RangeError with strict that names the date.

arqam.toDate("31/2/2026")
→""
arqam.toDate("31/2/2026", {strict: "on"})
→RangeError: arqamAR: "31/2/2026" does not exist
#Q279
Q280Can the year be written in the classical order?Intermediate

wordOrder: "small" writes the year smallest part first: ستة وعشرين وألفين.

arqam.toDate("18/11/2026", {wordOrder: "small", year: "sana"})
→الثامن عشر من شهر نوفمبر سنة ست وعشرين وألفين ميلادية
#Q280
Q281Can I pass a Date object?Advanced

Yes: its own calendar day is used (in the time zone of the machine).

arqam.toDate(new Date(2026, 10, 18))
→الثامن عشر من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد
#Q281
Q282Can I write several dates at once?Advanced

Pass an array; you get an array.

arqam.toDate(["1/1/2026", "29/2/2024"], {style: "compact"})
→1 يناير 2026م29 فبراير 2024م
#Q282
Q283Which years can be written?Advanced

Years with four digits; a Hijri date must be after the Hijra (year 1 AH starts in 622 CE).
Leap years are checked.

arqam.toDate("29/2/2024", {style: "compact"})
→29 فبراير 2024م
arqam.toDate("29/2/2023", {style: "compact"})
→""
#Q283
Q284Can the date text include a time, such as 2026-11-18T10:30?Intermediate

Yes; the time is ignored and only the day is written.
Use toTime() for the time.

arqam.toDate("2026-11-18T10:30")
→الثامن عشر من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد
arqam.toTime("10:30")
→الساعة العاشرة وثلاثون دقيقةً صباحًا
#Q284
Q285Can a compact date use Arabic-Eastern digits?Intermediate

arabicNumbers: "on".

arqam.toDate("18/11/2026", {calendar: "h", style: "compact", arabicNumbers: "on"})
→٨ جمادى الآخرة ١٤٤٨هـ
#Q285
Q286Why can the Hijri date differ by a day from a printed calendar?Advanced

The engine uses the Umm al-Qura calendar, which is calculated in advance.
Some countries fix the start of a month by sighting the moon, so their date can be a day earlier or later.

#Q286
Q287Which date texts are accepted?Beginner

"18/11/2026", "18-11-2026", "18.11.2026", "2026-11-18", "18 نوفمبر 2026", "November 18, 2026", Arabic-Eastern digits, and a Date object.
The year must have four digits.

arqam.toDate("18.11.2026", {style: "compact"})
→18 نوفمبر 2026م
arqam.toDate("١٨/١١/٢٠٢٦", {style: "compact"})
→18 نوفمبر 2026م
arqam.toDate("18/11/26")
→""
#Q287
Q288How do I write today's date?Beginner

Pass new Date().

arqam.toDate(new Date(), {calendar: "b"});
#Q288
Q289How are the months named in Morocco?Intermediate

months: "morocco": يناير، فبراير … يوليوز، غشت، شتنبر … دجنبر.

arqam.toDate("1/8/2026", {months: "morocco", style: "compact"})
→1 غشت 2026م
arqam.toDate("1/12/2026", {months: "morocco", style: "compact"})
→1 دجنبر 2026م
#Q289
Q290Can I write the year with «عام»?Intermediate

year: "aam".

arqam.toDate("18/11/2026", {year: "aam"})
→الثامن عشر من شهر نوفمبر عام ألفين وستة وعشرين ميلادي
#Q290
Q291How do I write the date with full tashkeel?Intermediate

tashkeel: "full".

arqam.toDate("18/11/2026", {tashkeel: "full"})
→الثَّامِنَ عَشَرَ مِنْ شَهْرِ نُوفَمْبِرَ لِعَامِ أَلْفَيْنِ وَسِتَّةٍ وَعِشْرِينَ لِلْمِيلَادِ
#Q291
Q292How do I write a Hijri date with the Gregorian equivalent?Intermediate

Give the Hijri date with input: "h" and calendar: "b": the Hijri date comes first.

arqam.toDate("1/9/1447", {input: "h", calendar: "b", style: "compact"})
→1 رمضان 1447هـ، الموافق 18 فبراير 2026م
#Q292
Q293Which years can be converted to Hijri?Intermediate

Gregorian dates with four-digit years from the Hijra (July 622) onwards; earlier dates give the isNaN value.

arqam.toDate(["1/1/1900", "1/1/2100"], {calendar: "h", style: "compact"})
→29 شعبان 1317هـ20 شوال 1523هـ
arqam.toDate("1/1/622", {calendar: "h"})
→""
#Q293
Q294Does the compact style use the era «م» and «هـ»?Intermediate

Yes by default; era: "long" or "none" change it.

arqam.toDate("18/11/2026", {style: "compact", era: "long"})
→18 نوفمبر 2026 للميلاد
arqam.toDate("18/11/2026", {style: "compact", era: "none"})
→18 نوفمبر 2026
#Q294
Q295Is the date in words agreed with the year word?Advanced

Yes: لعام … للميلاد, سنة … ميلادية, عام … ميلادي; the number agrees with سنة (feminine).

arqam.toDate("18/11/2026", {year: "sana"})
→الثامن عشر من شهر نوفمبر سنة ألفين وست وعشرين ميلادية
#Q295
Q296Can I get the Hijri month names only?Advanced

Use the compact Hijri style and take the month from it, or keep your own list.

arqam.toDate("18/11/2026", {calendar: "h", style: "compact"}).split(" ").slice(1, -1).join(" ")
→جمادى الآخرة
#Q296

13.15 Times and durations (21)

toTime(): the hour, the minutes, the part of the day and durations.

Q297How do I write a time in words?Beginner

toTime(time) takes "15:45", "3:15 pm", "3:15 م", "07:05:30", Arabic-Eastern digits, or a Date.

arqam.toTime("15:45")
→الساعة الثالثة وخمس وأربعون دقيقةً عصرًا
arqam.toTime("3:15 pm")
→الساعة الثالثة وخمس عشرة دقيقةً عصرًا
arqam.toTime("07:05:30")
→الساعة السابعة وخمس دقائق وثلاثون ثانيةً صباحًا
#Q297
Q298Which time styles are there?Beginner

timeStyle: "common" (the default: the part of the day in everyday words), "exact" (صباحًا/ظهرًا/مساءً), "h24" (the 24-hour clock) and "duration".

arqam.toTime("15:45", {timeStyle: "exact"})
→الساعة الثالثة وخمس وأربعون دقيقةً مساءً
arqam.toTime("15:45", {timeStyle: "h24"})
→الساعة الخامسة عشرة وخمس وأربعون دقيقةً
#Q298
Q299How do I write a duration such as 2:30?Beginner

timeStyle: "duration"; a duration may have more than 23 hours.

arqam.toTime("2:30", {timeStyle: "duration"})
→ساعتان ونصف
arqam.toTime("125:10", {timeStyle: "duration"})
→مائة وخمس وعشرون ساعةً وعشر دقائق
#Q299
Q300How is the time just after midnight written?Intermediate

From 0:01 to 0:59 the time is «بعد منتصف الليل» in every clock style.

arqam.toTime("0:25")
→الساعة الثانية عشرة وخمس وعشرون دقيقةً بعد منتصف الليل
arqam.toTime("0:25", {timeStyle: "exact"})
→الساعة الثانية عشرة وخمس وعشرون دقيقةً بعد منتصف الليل
#Q300
Q301How do I get «الرابعة إلا الربع»?Intermediate

timeParts: "on" (the "common" style only) uses the hour's parts: والربع، والنصف، إلا الربع.
Without it the minutes are counted.

arqam.toTime("15:45")
→الساعة الثالثة وخمس وأربعون دقيقةً عصرًا
arqam.toTime("15:45", {timeParts: "on"})
→الساعة الرابعة إلا الربع عصرًا
arqam.toTime("13:35", {timeParts: "on"})
→الساعة الواحدة والنصف وخمس دقائق ظهرًا
#Q301
Q302How do I leave out «الساعة», the part of the day or the seconds?Intermediate

timeWord: "off", timePeriod: "off", timeSeconds: "off".

arqam.toTime("07:05:30", {timeWord: "off", timePeriod: "off", timeSeconds: "off"})
→السابعة وخمس دقائق
#Q302
Q303What happens with 25:00?Intermediate

A clock time has hours 0–23.
You get the isNaN value, or a RangeError with strict that suggests the duration style.

arqam.toTime("25:00")
→""
arqam.toTime("25:00", {strict: "on"})
→RangeError: arqamAR: the hour goes from 0 to 23 (a longer time is a duration: timeStyle "duration")
#Q303
Q304Why does timeParts with timeStyle "exact" throw an error?Advanced

Because the parts of the hour belong to the everyday style; the exact style always counts the minutes.
The error says so, so the mistake is found early.

arqam.toTime("13:35", {timeParts: "on", timeStyle: "exact"})
→TypeError: arqam.toTime: timeParts applies only to timeStyle "common" (got timeStyle "exact")
#Q304
Q305Can I get the time with full tashkeel?Advanced

Yes, toTime() shares the tashkeel options.

arqam.toTime("15:45", {tashkeel: "full"})
→السَّاعَةُ الثَّالِثَةُ وَخَمْسٌ وَأَرْبَعُونَ دَقِيقَةً عَصْرًا
#Q305
Q306Can I write «م» and «ص» for pm and am?Beginner

Yes, as well as "am"/"pm".
Arabic-Eastern digits work too.

arqam.toTime("3:15 م")
→الساعة الثالثة وخمس عشرة دقيقةً عصرًا
arqam.toTime("٣:١٥")
→الساعة الثالثة وخمس عشرة دقيقةً فجرًا
#Q306
Q307Can I write several times at once?Intermediate

Pass an array; you get an array.

arqam.toTime(["1:00", "13:35", "18:00"])
→الساعة الواحدة ليلًاالساعة الواحدة وخمس وثلاثون دقيقةً ظهرًاالساعة السادسة مساءً
#Q307
Q308How are noon and midnight written?Beginner

12:00 is ظهرًا; 0:00 is «منتصف الليل».

arqam.toTime("12:00")
→الساعة الثانية عشرة ظهرًا
arqam.toTime("0:00")
→منتصف الليل
#Q308
Q309Which parts of the day does the common style use?Beginner

ليلا، فجرا، صباحا، ظهرا، عصرا، مساء, by the hour.

arqam.toTime(["2:00", "4:30", "9:00", "13:00", "16:00", "20:00"])
→الساعة الثانية ليلًاالساعة الرابعة وثلاثون دقيقةً فجرًاالساعة التاسعة صباحًاالساعة الواحدة ظهرًاالساعة الرابعة عصرًاالساعة الثامنة مساءً
#Q309
Q310How are half past, a third and a quarter written with timeParts?Intermediate

والنصف، والثلث، والربع، إلا الربع، إلا الثلث.

arqam.toTime(["18:30", "5:20", "7:15", "7:40", "7:45"], {timeParts: "on"})
→الساعة السادسة والنصف مساءًالساعة الخامسة والثلث فجرًاالساعة السابعة والربع صباحًاالساعة الثامنة إلا الثلث صباحًاالساعة الثامنة إلا الربع صباحًا
#Q310
Q311How is a short duration written?Intermediate

Minutes and seconds only, with the parts of the hour where they fit.

arqam.toTime("0:45", {timeStyle: "duration"})
→ثلاثة أرباع الساعة
arqam.toTime("0:00:30", {timeStyle: "duration"})
→ثلاثون ثانيةً
arqam.toTime("1:15", {timeStyle: "duration"})
→ساعة وربع
#Q311
Q312How are the seconds written?Intermediate

After the minutes, when they are not 00.

arqam.toTime("10:05:09")
→الساعة العاشرة وخمس دقائق وتسع ثوان صباحًا
#Q312
Q313Can I pass a Date object to toTime()?Intermediate

Yes: its local time is used.

arqam.toTime(new Date(2026, 0, 1, 15, 45))
→الساعة الثالثة وخمس وأربعون دقيقةً عصرًا
#Q313
Q314How do I write the time without the word الساعة?Intermediate

timeWord: "off".

arqam.toTime("9:00", {timeWord: "off"})
→التاسعة صباحًا
#Q314
Q315Is 24:00 accepted?Advanced

No; write 0:00 (midnight), or use the duration style for 24 hours.

arqam.toTime("24:00")
→""
arqam.toTime("24:00", {timeStyle: "duration"})
→أربع وعشرون ساعةً
#Q315
Q316How is the hour agreed in the duration style?Advanced

ساعة is feminine, so the numbers take the forms a feminine noun needs: ثلاث ساعات، إحدى عشرة ساعة.

arqam.toTime(["3:00", "11:00", "21:00"], {timeStyle: "duration"})
→ثلاث ساعاتإحدى عشرة ساعةًإحدى وعشرون ساعةً
#Q316
Q317Can toTime() return «دقيقة» with tanween?Advanced

With tashkeel "alif" or more, the accusative noun takes it.

arqam.toTime("3:15", {tashkeel: "alif"})
→الساعة الثالثة وخمس عشرة دقيقةً فجرًا
#Q317

13.16 Standing options, instances and reset (15)

config(), options(), reset(), defaults and createArqam().

Q318What is the difference between config() and the options of one call?Beginner

config() sets standing options for every call that follows; the options of one call apply to that call only and are then forgotten.

arqam.config({currency: "QAR"})
arqam("30")
→ثلاثون ريالًا قطريًا
arqam("20", {currency: "USD"})
→عشرون دولارًا أمريكيًا
this call only
arqam("30")
→ثلاثون ريالًا قطريًا
back to riyals
arqam.reset()
#Q318
Q319How do I go back to the defaults?Beginner

reset(). Registered currencies stay.

arqam.config({tashkeel: "full", currency: "KWD"})
arqam.reset()
arqam("3")
→ثلاثة
#Q319
Q320How do I see the current options?Beginner

options() returns a copy; changing the copy changes nothing.

arqam.config({currency: "QAR", tashkeel: "endings"})
arqam.options().currency + " " + arqam.options().tashkeel
→"QAR p"
arqam.reset()
#Q320
Q321Where are the defaults listed?Beginner

arqam.defaults (a copy), and the table in 12.10.

arqam.defaults.tashkeel === "" && arqam.defaults.ierab
→"r"
#Q321
Q322Do one call's options ever stay behind?Intermediate

No. After every call the standing options are exactly as before; the tests check this after every kind of call.

arqam("5", {currency: "MAD", tashkeel: "full", brackets: "end"})
→خَمْسَةُ دَرَاهِمَ مَغْرِبِيَّةٍ (5.00 MAD)
arqam("5")
→خمسة
#Q322
Q323What is createArqam() for?Intermediate

It makes an instance with its own options, starting from the defaults.
Use it when parts of a program need different settings, for example two tenants or two document types, without changing each other.

const doha = arqam.createArqam({currency: "QAR", tashkeel: "full"})
const kuwait = arqam.createArqam({currency: "KWD"})
doha.toWords("2.5")
→رِيَالَانِ قَطَرِيَّانِ، وَخَمْسُونَ دِرْهَمًا
kuwait.toWords("2.5")
→ديناران كويتيان، وخمسمائة فلس
arqam("2.5")
→اثنان، وخمسة أجزاء من العشرة
the global object is untouched
#Q323
Q324Does an instance have every method?Intermediate

toWords, toParts, toDate, toTime, toFraction, config, options, reset, registerCurrency, removeTashkeel and nisba.
The currency table is shared.

typeof arqam.createArqam().toDate
→"function"
#Q324
Q325Is it safe to use the global object from different parts of my code?Advanced

Calls with their own options are always safe.
Standing options set with config() are shared, so a library or a plug-in should use its own instance from createArqam() rather than calling config() on the global object.

#Q325
Q326Does the misspelt option name cause silent mistakes?Advanced

No: an unknown option throws a TypeError and suggests the right name.

arqam("5", {tashkel: "full"})
→TypeError: arqam.toWords: unknown option "tashkel"; did you mean "tashkeel"?
#Q326
Q327Can config() take the readable names?Advanced

Yes, every option that takes coded values accepts the names and the codes; options() stores the short codes.

arqam.config({tashkeel: "endings", ierab: "nasb"})
arqam.options().tashkeel + arqam.options().ierab
→"pn"
arqam.reset()
#Q327
Q328Can I change an instance's options later?Intermediate

Yes: an instance has its own config() and reset(), which touch only that instance.
Note that reset() takes it back to the library defaults, not to the options it was created with.

const inv = arqam.createArqam({currency: "QAR"})
inv.config({brackets: "end"})
inv.toWords("12.5")
→اثنا عشر ريالًا قطريًا، وخمسون درهمًا (12.50 QAR)
inv.reset()
inv.toWords("12.5")
→اثنا عشر، وخمسة أجزاء من العشرة
#Q328
Q329Does createArqam() copy my current standing options?Intermediate

No; it starts from the defaults plus the options you give.

arqam.config({currency: "QAR"})
arqam.createArqam().toWords("3")
→ثلاثة
arqam.reset()
#Q329
Q330Can two instances run at the same time in async code?Intermediate

Yes: each call is synchronous and leaves no state behind, so calls from different async tasks never mix.

#Q330
Q331How much does an instance cost?Advanced

Very little: it keeps only its options.
Make one per tenant or document type and keep it.

#Q331
Q332Can I freeze the global options so nothing changes them?Advanced

Use an instance for your code and do not call config() on the global object; options() lets you check them in tests.

JSON.stringify(arqam.options()) === JSON.stringify(arqam.defaults)
→true
#Q332

13.17 Option names and values (7)

Readable names, short codes, switches and what is refused.

Q333Should I write the readable name or the short code?Beginner

Either. The names (tashkeel: "full") are easier to read in your code; the codes (tashkeel: "f") are shorter.
They give the same words.

arqam("12", {tashkeel: "full", ierab: "jarr"}) === arqam("12", {tashkeel: "f", ierab: "j"})
→true
#Q333
Q334Which options take names?Beginner

Six: tashkeel, ierab, legal, numSymbol, decFormat and ordinal.
arqam.optionNames lists every name with its code.

Object.keys(arqam.optionNames).join(", ")
→"tashkeel, ierab, legal, numSymbol, decFormat, ordinal"
#Q334
Q335How are on/off options written?Beginner

"on" or "off"; true and false are accepted too, and "" means off.

arqam("1234567", {comma: false})
→مليون ومائتان وأربعة وثلاثون ألفًا وخمسمائة وسبعة وستون
arqam("1234567", {compact: true})
→مليون و234 ألفًا و567
#Q335
Q336What happens with a wrong value?Intermediate

A TypeError that lists every accepted value, as the name and the code.

arqam("5", {tashkeel: "x"})
→TypeError: arqam.toWords: tashkeel must be one of "none" or "n", "alif" or "a", "fatha" or "h", "tanween" or "t", "endings" or "p", "full" or "f", "" (got "x")
arqam("5", {ierab: "accusative"})
→TypeError: arqam.toWords: ierab must be one of "raf" or "r", "nasb" or "n", "jarr" or "j", "" (got "accusative")
#Q336
Q337Where are the old values such as "fatih" and "partial"?Intermediate

They are not values; use "fatha" and "endings". legal "off" is "none".

arqam("5", {tashkeel: "fatha"})
→خمسة
arqam("5", {legal: "off"})
→TypeError: arqam.toWords: legal must be one of "none" or "n", "auto" or "a", "full" or "f", "" (got "off")
#Q337
Q338Can I list every option and its default in code?Advanced

Object.keys(arqam.defaults); the TypeScript declarations describe each one.

Object.keys(arqam.defaults).length
→63
#Q338
Q339Are option values case-sensitive or space-sensitive?Intermediate

The coded values and the switches are read in any letter case and with spaces around them trimmed.

arqam("5", {currency: "QAR", tashkeel: " Full "})
→خَمْسَةُ رِيَالَاتٍ قَطَرِيَّةٍ
arqam("1234567", {comma: "OFF"})
→مليون ومائتان وأربعة وثلاثون ألفًا وخمسمائة وسبعة وستون
#Q339

13.18 Every option, one by one (39)

Each option of toWords() and toParts(), what it does and an example; the defaults are listed in 12.10.

Q340What does code do?Beginner

The currency code ("" for numbers).
Text as the second parameter is a shortcut for it.

arqam("3", {currency: "KWD"})
→ثلاثة دنانير كويتية
#Q340
Q341What does tashkeel do?Beginner

The vowel marks: alif (the default: the tanween alif, ريالًا), none, fatha, tanween, endings, full.

arqam("3", {currency: "KWD", tashkeel: "endings"})
→ثلاثةُ دنانيرَ كويتيةٍ
#Q341
Q342What does ierab do?Beginner

The case: raf (default), nasb, jarr.

arqam("22", {currency: "KWD", ierab: "jarr"})
→اثنين وعشرين دينارًا كويتيًا
#Q342
Q343What does brackets do?Beginner

The figure in brackets: "" (none), "end", "start", or "decimals" (the fraction's words in brackets).

arqam("3.5", {currency: "KWD", brackets: "start"})
→(3.500 KWD) ثلاثة دنانير كويتية، وخمسمائة فلس
#Q343
Q344What do prefix and suffix do?Beginner

Words before and after, such as فقط and لا غير.
They are not written for a percentage.

arqam("3", {currency: "KWD", prefix: "فقط", suffix: "لا غير"})
→فقط ثلاثة دنانير كويتية لا غير
#Q344
Q345What does legal do?Beginner

The scale word repeated after hundreds: none (default), auto, full.

arqam("102000", {legal: "full"})
→مائة ألف وألفان
#Q345
Q346What does decFormat do?Beginner

The form of the decimal part (ten values; see 12.13).

arqam("3.5", {decFormat: "figures"})
→ثلاثة، فاصلة 5
#Q346
Q347What does rounding do?Beginner

Round extra decimals half up instead of cutting them.

arqam("3.456", {currency: "QAR", rounding: "on"})
→ثلاثة ريالات قطرية، وستة وأربعون درهمًا
#Q347
Q348What does percent do?Beginner

Read the number as a percentage.

arqam("3.5", {percent: "on"})
→ثلاثة فاصلة خمسة بالمائة
#Q348
Q349What do ordinal and ordinalDefinite do?Beginner

The ordinal (masculine or feminine), with or without الـ.

arqam("3", {ordinal: "feminine", ordinalDefinite: "off"})
→ثالثة
#Q349
Q350What does bracketsType do?Intermediate

The two bracket characters (default "()").

arqam("3", {currency: "KWD", brackets: "end", bracketsType: "{}"})
→ثلاثة دنانير كويتية {3.000 KWD}
#Q350
Q351What does numSymbol do?Intermediate

The label after the figure: code, english, native, sign (the Symbol), name, none or your own text.

arqam("3", {currency: "KWD", brackets: "end", numSymbol: "symbol"})
→ثلاثة دنانير كويتية (3.000 د.ك.)
#Q351
Q352What do sepThousands and sepDecimal do?Intermediate

The separators of the figure in brackets: characters or a locale tag.
Set both together: with a locale for one only, the two separators can be the same character.

arqam("12345.5", {currency: "KWD", brackets: "end", sepThousands: "de", sepDecimal: "de"})
→اثنا عشر ألفًا وثلاثمائة وخمسة وأربعون دينارًا كويتيًا، وخمسمائة فلس (12.345,500 KWD)
arqam("12345.5", {currency: "KWD", brackets: "end", sepThousands: "de"})
→اثنا عشر ألفًا وثلاثمائة وخمسة وأربعون دينارًا كويتيًا، وخمسمائة فلس (12.345.500 KWD)
#Q352
Q353What does arabicNumbers do?Intermediate

Arabic-Eastern digits in the figure in brackets.

arqam("12.5", {currency: "KWD", brackets: "end", arabicNumbers: "on"})
→اثنا عشر دينارًا كويتيًا، وخمسمائة فلس (١٢٫٥٠٠ KWD)
#Q353
Q354What does currDecForce do?Intermediate

Show the currency's places in the figure (default on).

arqam("12", {currency: "KWD", brackets: "end", currDecForce: "off"})
→اثنا عشر دينارًا كويتيًا (12 KWD)
#Q354
Q355What does scale do?Intermediate

The names of large numbers: arabic (default), short, long.

arqam("3000000000", {scale: "short"})
→ثلاثة بلايين
#Q355
Q356What does compact do?Intermediate

Groups as figures, scale words in letters.

arqam("3500000", {compact: "on"})
→3 ملايين و500 ألف
#Q356
Q357What does comma do?Intermediate

The Arabic comma before و between groups (default off; switch it on to use it).

arqam("3500000", {comma: "on"})
→ثلاثة ملايين، وخمسمائة ألف
#Q357
Q358What do miah and miahSplit do?Intermediate

مائة or مئة, and the hundreds written apart.

arqam("500", {miah: "off", miahSplit: "on"})
→خمس مئة
#Q358
Q359What does tanweenAlif do?Intermediate

The tanween on the alif itself (ريالاً) instead of the letter before it.

arqam("30", {currency: "QAR", tashkeel: "alif", tanweenAlif: "on"})
→ثلاثون ريالاً قطرياً
#Q359
Q360What does addZero do?Intermediate

«صفر» before a fraction of one.

arqam("0.25", {addZero: "on"})
→صفر، وخمسة وعشرون جزءًا من المائة
#Q360
Q361What does decJuz do?Intermediate

The word جزء in the fraction (default on).

arqam("0.25", {decJuz: "off"})
→خمسة وعشرون من المائة
#Q361
Q362What does decAL do?Intermediate

الـ in من المائة (default on).

arqam("0.25", {decAL: "off"})
→خمسة وعشرون جزءًا من مائة
#Q362
Q363What does decFaslah do?Intermediate

«فاصلة» before the fraction instead of «و».

arqam("3.25", {decFaslah: "on"})
→ثلاثة، فاصلة خمسة وعشرون جزءًا من المائة
#Q363
Q364What does decIgnore do?Intermediate

The whole part only.

arqam("3.25", {currency: "USD", decIgnore: "on"})
→ثلاثة دولارات أمريكية
#Q364
Q365What does decRound do?Intermediate

The decimal places kept in numbers mode: "" (the default) keeps every decimal; a number keeps that many (the rest are cut, or rounded with rounding "on").

arqam("3.14159", {decRound: 3})
→ثلاثة، ومائة وواحد وأربعون جزءًا من الألف
#Q365
Q366What does ignoreCountry do?Intermediate

The currency name without its country.

arqam("3", {currency: "EGP", ignoreCountry: "on"})
→ثلاثة جنيهات
#Q366
Q367What does isNaN do?Intermediate

What to return for a number that cannot be written (default "").

arqam("3,5", {isNaN: "?"})
→"?"
#Q367
Q368What does strict do?Intermediate

Throw an error that says why, instead of returning isNaN: a TypeError when the input is not a number, a RangeError when the number cannot be written that way.
Catch it with try … catch.

arqam("3,5", {strict: "on"})
→TypeError: arqam.toWords: "3,5" is not a number in the form 1234.56 (digits, an optional ".", and "-" before or "%" after)
arqam("abc", {strict: "on"})
→TypeError: arqam.toWords: "abc" is not a number in the form 1234.56 (digits, an optional ".", and "-" before or "%" after)
arqam(Infinity, {strict: "on"})
→RangeError: arqam.toWords: Infinity cannot be written in words
#Q368
Q369What does split do?Intermediate

Colour markers in the words (see "Colouring").

arqam("3.5", {currency: "QAR", split: "on"})
→ثلاثة|c ريالات قطرية|p، و|f||f|خمسون |cدرهمًا
#Q369
Q370What does wordOrder do?Intermediate

"small": the smallest part first (classical); "" or "large": the largest first.

arqam("3500", {wordOrder: "small"})
→خمسمائة، وثلاثة آلاف
#Q370
Q371What does majorGender (without a code) do?Intermediate

Numbers for a feminine counted noun.

arqam("3", {majorGender: 1})
→ثلاث
#Q371
Q372What do currDecimal, majorSingle, majorPlural … (one-off currency) do?Advanced

A currency for one call only, given by its names in the options. registerCurrency() is the better way because the names are checked once and kept.

arqam("3.5", { currency: "XXA", currDecimal: 2, majorSingle: "كوكو", majorPlural: "كوكوات", minorSingle: "كاكا", minorPlural: "كاكات" })
→ثلاثة كوكوات، وخمسون كاكًا
#Q372
Q373What do majorSingleC, majorPluralC, minorSingleC, minorPluralC do?Advanced

The adjective (usually the country) after each name: ريال قطري، ريالات قطرية. registerCurrency() makes them from country.

arqam.registerCurrency("ZZC", {majorSingle: "دينار", majorPlural: "دنانير", majorSingleC: "جديد", majorPluralC: "جديدة"}) && ""
→""
arqam("3", {currency: "ZZC"})
→ثلاثة دنانير جديدة
arqam("11", {currency: "ZZC"})
→أحد عشر دينارًا جديدًا
#Q373
Q374What do the T names (majorSingleT … minorPluralCT) do?Advanced

The same names with full tashkeel, used when tashkeel is not "none".

arqam.registerCurrency("ZZK", {majorSingle: "كتاب", majorPlural: "كتب", majorSingleT: "كِتَاب", majorPluralT: "كُتُبٍ"}) && ""
→""
arqam("2", {currency: "ZZK", tashkeel: "full"})
→كِتَابَانِ
#Q374
Q375What does minorGender do?Advanced

1 for a feminine minor unit (هللة).

arqam.registerCurrency("ZZM", { majorSingle: "ريال", majorPlural: "ريالات", minorSingle: "هللة", minorPlural: "هللات", minorGender: 1 // 1 = feminine }) && ""
→""
arqam("3.03", {currency: "ZZM"})
→ثلاثة ريالات، وثلاث هللات
#Q375
Q376What do qualifier, idafa, country, symbolNative, symbolLatin, openDecimals do?Advanced

Attributes of registerCurrency() only (not toWords() options): a fixed phrase after the number, the second term of an iḍāfa, the place name, the two symbols, and open decimals.
See "Currencies" and "Units".

arqam("3", {qualifier: "x"})
→TypeError: arqam.toWords: unknown option "qualifier"
#Q376
Q377Which options apply to toDate(), toTime() and toFraction()?Advanced

Each has its own options (see their sections) and shares a few with toWords(): tashkeel, miah, strict and isNaN for all; arabicNumbers and wordOrder for dates; tanweenAlif for times and fractions; code, ignoreCountry and comma for fractions.
Any other option is refused with a TypeError.

arqam.toDate("1/1/2026", {currency: "EGP"})
→TypeError: arqam.toDate: unknown option "currency" (toDate takes calendar, input, style, months, year, era, order, gora, ierab, tashkeel, arabicNumbers, miah, strict, isNaN, wordOrder, locale, timeZone)
#Q377
Q378What does emphasisOneTwo do?Intermediate

«واحد» and «اثنان» after the noun, for one and two of a currency or a counted noun: "" (the default) leaves them out (ريالان قطريان) but in the legal form and the cheque form («فقط … لا غير»); "on" always writes them, "off" never.

arqam("2", {currency: "QAR"})
→ريالان قطريان
arqam("2", {currency: "QAR", prefix: "فقط", suffix: "لا غير"})
→فقط ريالان قطريان اثنان لا غير
arqam("1", {currency: "QAR", emphasisOneTwo: "on"})
→ريال قطري واحد
#Q378

13.19 Every method and property (34)

What each method takes and returns.

Q379What do toWords(number, [code | options]) give?Beginner

The words, as a string; an array gives an array.

arqam("7", {currency: "BHD"})
→سبعة دنانير بحرينية
#Q379
Q380What do toParts(number, [code | options]) give?Beginner

The words in their parts (an object); an array gives an array.

Object.keys(arqam.toParts("7", "BHD")).join(", ")
→"text, valid, negative, percent, ordinal, prefix, sign, whole, fraction, suffix, brackets, figure"
#Q380
Q381What do toDate(date, [options]) give?Beginner

A date in words; an array gives an array.

arqam.toDate("7/7/2027", {style: "compact"})
→7 يوليو 2027م
#Q381
Q382What do toTime(time, [options]) give?Beginner

A time or a duration in words; an array gives an array.

arqam.toTime("7:07")
→الساعة السابعة وسبع دقائق صباحًا
#Q382
Q383What do toFraction(fraction, [options]) give?Beginner

A typed fraction in words; an array gives an array.

arqam.toFraction("7/8")
→سبعة أثمان
#Q383
Q384What does config(options) give?Beginner

Sets standing options; returns nothing.

arqam.config({currency: "BHD"})
arqam("7")
→سبعة دنانير بحرينية
arqam.reset()
#Q384
Q385What does reset() give?Beginner

Back to the defaults; registered currencies stay.

arqam.config({currency: "BHD"})
arqam.reset()
arqam.options().currency
→""
#Q385
Q386What does options() give?Beginner

A copy of the standing options.

arqam.options().ierab
→"r"
#Q386
Q387What does createArqam([options]) give?Intermediate

A new instance with its own options, starting from the defaults plus the options given.

arqam.createArqam({currency: "BHD"}).toWords("7")
→سبعة دنانير بحرينية
#Q387
Q388What do registerCurrency(code, attributes) give?Intermediate

Adds or changes a currency; returns a copy of its row; throws a TypeError on a mistake.

Array.isArray(arqam.registerCurrency("ZZA", {majorSingle: "كوكو", majorPlural: "كوكوات"}))
→true
#Q388
Q389What do removeTashkeel(text, [options]) give?Intermediate

The text without its marks; an array gives an array.

arqam.removeTashkeel(["سَبْعَةٌ", "ثَمَانِيَةٌ"])
→سبعةثمانية
#Q389
Q390What do nisba(name, [options]) give?Intermediate

The نسبة adjective of a place name; feminine with {feminine: true}.

arqam.nisba("الأردن")
→أردني
arqam.nisba("الأردن", {feminine: true})
→أردنية
#Q390
Q391What do version, defaults, currencies, optionNames give?Intermediate

Read-only properties: the engine version, a copy of the defaults, the currency table and the readable option names.

arqam.version + " · " + Object.keys(arqam.optionNames).length + " coded options"
→"1.85 · 6 coded options"
#Q391
Q392What do fromWords(text, [options]) give?Intermediate

With the reader loaded: the number in the words, as text, or null.

arqam.fromWords("سبعة آلاف وسبعون")
→"7070"
#Q392
Q393What do findNumbers(text, [options]) give?Intermediate

With the reader loaded: every number in a text, with its place, value and currency.

arqam.findNumbers("بعت سبعة كتب بسبعين ريالا").map(x => x.value).join(", ")
→"7, 70"
#Q393
Q394What do verify(words, number, [options]) give?Intermediate

With the reader loaded: do the words say the number? {ok, reason, read, expected, currency}.

arqam.verify("سبعون", "70").ok
→true
#Q394
Q395What do explain(number, [options]) give?Intermediate

With explain loaded: the grammar of every word.

arqam.explain("7", {currency: "BHD"}).words.length
→3
#Q395
Q396What do explain.date(date, [options]) give?Intermediate

With explain loaded: the grammar of the words of a date.

arqam.explain.date("7/7/2027").text
→السابع من شهر يوليو لعام ألفين وسبعة وعشرين للميلاد
#Q396
Q397What do arqamWordsToNumbers(text, [options]) and its methods give?Advanced

The reader itself: replaces the number words in a text; .value(), .find(), .verify(), .removeTashkeel() and .version.

wordsToNumbers("سبعة وسبعون")
→"77"
wordsToNumbers.value("سبعة وسبعون")
→"77"
wordsToNumbers.version
→"1.02"
#Q397
Q398What do arqamExplain(number, [options]), .date(), .rules, .version give?Advanced

The explain function itself; rules lists every rule it knows by id, with a title, text and example.

Object.keys(arqamExplain.rules).length + " rules, version " + arqamExplain.version
→"61 rules, version 0.94"
arqamExplain.rules[arqam.explain("5", {currency: "MAD"}).order[0]].title
→3–10 تخالف المعدود
#Q398
Q399Which methods does the plain script arqamAR.js have?Advanced

All of them, on one global arqamAR: every method and the properties version, defaults, currencies and optionNames.
Only the named exports (import {toWords} …) are a module feature.

Use the plain script for pages opened from disk, the module elsewhere.

#Q399
Q400What do signs and symbols give?Intermediate

The Symbol of every currency that has one (81 of them): its one-character Unicode sign, such as ⃁ for the Saudi riyal, $ or €.
It is kept in the currency's row, with its other names; numSymbol: "sign" writes it in the brackets, and registerCurrency(code, {symbol}) sets it ("" removes it).

symbols is the same list.

arqam.signs.SAR
→"⃁"
Object.keys(arqam.signs).length
→81
arqam("5", {currency: "SAR", numSymbol: "sign", brackets: "end"})
→خمسة ريالات سعودية (5.00 ⃁)
#Q400
Q401What does regions give?Intermediate

The 22 Arab League locales and what each one sets: the time zone, the currency, the month names, the digits and separators, and the capital's name, plain and with full tashkeel.
A locale option uses them.

Object.keys(arqam.regions).length
→22
arqam.regions["ar-QA"].currency + " · " + arqam.regions["ar-QA"].months + " · " + arqam.regions["ar-QA"].city
→QAR · gulf · الدوحة
#Q401
Q402What does timeZones give?Intermediate

The time zones Arqam names in Arabic, by their IANA name: the city and the country, plain and with full tashkeel.
registerTimeZone(zone, name) adds one.

Object.keys(arqam.timeZones).length
→57
arqam.timeZones["Asia/Qatar"].city + " · " + arqam.timeZones["Asia/Qatar"].country
→الدوحة · قطر
#Q402
Q403What do utils.cardinal(number, [options]) give?Intermediate

The number words alone, with no currency: masculine by default, feminine with {gender: "feminine"}; the other options of toWords (tashkeel, ierab …) apply.

arqam.utils.cardinal("13", {gender: "feminine"})
→ثلاث عشرة
arqam.utils.cardinal("1250", {tashkeel: "full"})
→أَلْفٌ وَمِائَتَانِ وَخَمْسُونَ
#Q403
Q404What do utils.toCase(words, ierab) give?Intermediate

Number words written in the nominative, put in the accusative ("nasb") or the genitive ("jarr"), as the engine itself writes that case: the tens (وعشرون → وعشرين), the duals (اثنا عشر → اثني عشر), the hundreds, and the vowels too when the words carry them.
Words with no marks get the alif of the accusative (ألفا).

arqam.utils.toCase("ثلاثة وعشرون", "jarr")
→ثلاثة وعشرين
arqam.utils.toCase("ألف ومائة واثنا عشر", "nasb")
→ألفا ومائة واثني عشر
arqam.utils.toCase(arqam("212", {tashkeel: "full"}), "jarr")
→مِائَتَيْنِ وَاثْنَي عَشَرَ
#Q404
Q405What do utils.scaleName(power, [options]) give?Advanced

The scale word of 10 to the power 3 × power: 1 ألف, 2 مليون, 3 مليار … of any size; {plural: true}, {tashkeel: true}, and {scale: "short"} or "long" (in the long scale بليون is 10 to the power 12).

arqam.utils.scaleName(3)
→مليار
arqam.utils.scaleName(2, {plural: true, tashkeel: true})
→مَلَايِين
arqam.utils.scaleName(4, {scale: "long"})
→بليون
#Q405
Q406What do utils.parseTime(text, [options]) give?Advanced

A time as toTime() reads it: {hour, minute, second}, the hour from 0 to 23; {duration: true} reads a duration.
Text that is not a time throws an error that says why.

JSON.stringify(arqam.utils.parseTime("3:15 م"))
→{"hour":15,"minute":15,"second":0}
JSON.stringify(arqam.utils.parseTime("2:30", {duration: true}))
→{"hour":2,"minute":30,"second":0}
#Q406
Q407What do utils.parseFraction(text, [options]) give?Advanced

A typed fraction as toFraction() reads it: {whole, numerator, denominator}; with the options of toFraction (fractionSimplify …), the fraction it writes.

JSON.stringify(arqam.utils.parseFraction("3 1/2"))
→{"whole":"3","numerator":1,"denominator":2}
JSON.stringify(arqam.utils.parseFraction("6/8", {fractionSimplify: "on"}))
→{"whole":"0","numerator":3,"denominator":4}
#Q407
Q408What do utils.fromHijri(year, month, day) give?Advanced

The Gregorian day of a Hijri (Umm al-Qura) date: {year, month, day, date}; a Hijri day that does not exist throws a RangeError.
utils.hijri(date) goes the other way.

[arqam.utils.fromHijri(1447, 9, 1)].map(g => g.day + "/" + g.month + "/" + g.year)[0]
→"18/2/2026"
arqam.utils.fromHijri(1447, 2, 30)
→RangeError: arqam.utils.fromHijri: 1447/2/30 is not a Hijri date that exists
#Q408
Q409What does utils.normalize(text) give?Advanced

Text made comparable: no tashkeel or tatweel; أ إ آ ٱ become ا، ى becomes ي، ة becomes ه، ؤ becomes و، ئ becomes ي; one space between words.
Two spellings of the same words give the same text.

arqam.utils.normalize("إِحْدَى عَشْرَةَ")
→احدي عشره
arqam.utils.normalize("إحدى عشرة") === arqam.utils.normalize("احدي عشره")
→true
#Q409
Q410What does utils.markOrder(text) give?Advanced

The marks in Unicode's standard order: a letter, its vowel, then the shadda, as every result of Arqam has them.
Use it on names you add or text you compare, so that the same word is the same text.

arqam.utils.markOrder("\u064A\u0651\u064C") === "\u064A\u064C\u0651"
→true
#Q410
Q411What do utils.suggest(word, list, [options]) give?Advanced

The nearest name of a list (letter case ignored), or "": the «did you mean» of Arqam's error messages.
{distance} is the most letters that may differ (default 2).

arqam.utils.suggest("tashkel", ["tashkeel", "ierab", "code"])
→"tashkeel"
arqam.utils.suggest("QRR", ["QAR", "SAR", "USD"])
→"QAR"
#Q411
Q412Are the methods safe to call with the wrong types?Advanced

Yes: a bad number gives the isNaN value (or an error with strict), and a bad option always gives a TypeError; nothing is changed by a failed call.

arqam({}, {currency: "QAR"})
→""
arqam.toDate(42)
→""
#Q412

13.20 Errors, validation and strict mode (13)

When you get an empty string, when an error, and how to handle both.

Q413Why do I get an empty string?Beginner

The number could not be written (not a number, too long, a bad date …) and the isNaN value, "" by default, was returned.
Use strict to find out why.

arqam("12,5")
→""
arqam("12,5", {strict: "on"})
→TypeError: arqam.toWords: "12,5" is not a number in the form 1234.56 (digits, an optional ".", and "-" before or "%" after)
#Q413
Q414What does strict: "on" do?Beginner
Q415How do I catch the errors?Beginner

Wrap the call in try … catch and tell TypeError (bad input) from RangeError (out of range).

try {
  cell.textContent = arqam(input, {currency: "SAR", strict: "on"});
} catch (e) {
  if (e instanceof RangeError) showMessage("The number is out of range: " + e.message);
  else if (e instanceof TypeError) showMessage("Not a number: " + e.message);
}
#Q415
Q416Are option mistakes errors even without strict?Intermediate

Yes. A misspelt option or a value that is not allowed always throws a TypeError, because it is a mistake in the code, not in the data.

arqam("5", {brakets: "end"})
→TypeError: arqam.toWords: unknown option "brakets"; did you mean "brackets"?
#Q416
Q417Can isNaN be something other than text?Intermediate

Yes, any value: null, a dash, a message.
It is returned as it is.

arqam("x", {isNaN: null})
→null
arqam("x", {isNaN: "—"})
→"—"
#Q417
Q418Which errors can registerCurrency() throw?Advanced

A TypeError for a bad code, a missing singular or plural, a singular without its plural, or a bad number of places.

arqam.registerCurrency("ZZE", {majorSingle: "كوكو"})
→TypeError: arqam.registerCurrency: a new currency needs majorSingle and majorPlural
arqam.registerCurrency("ZZE", {majorSingle: "كوكو", majorPlural: "كوكوات", currDecimal: 40})
→TypeError: arqam.registerCurrency: currDecimal must be a whole number from 0 to 18
#Q418
Q419Does an error leave the options changed?Advanced

No. A call that throws leaves the standing options exactly as they were.

arqam.config({currency: "QAR"})
arqam("x", {tashkeel: "full", strict: "on"})
→TypeError: arqam.toWords: "x" is not a number in the form 1234.56 (digits, an optional ".", and "-" before or "%" after)
arqam.options().tashkeel
→""
arqam.reset()
#Q419
Q420Which inputs give a RangeError with strict?Intermediate

A number that is too long, Infinity, an ordinal out of range, a date that does not exist, an hour above 23, a denominator of 0.

arqam("1" + "0".repeat(3004), {strict: "on"})
→عشرة ملينيليونات
#Q420
Q421Which inputs give a TypeError with strict?Intermediate

Text that is not a number, a date or a time in a form the engine does not read.

arqam.toDate("tomorrow", {strict: "on"})
→TypeError: arqamAR: "tomorrow" is not a date in the form 18/11/2026 or 2026-11-18
arqam.toTime("noon", {strict: "on"})
→TypeError: arqamAR: "noon" is not a time in the form 15:45, 3:15 pm or 07:05:30
#Q421
Q422Does strict apply to an array?Intermediate

Yes: the first bad item throws.

arqam(["5", "x"], {strict: "on"})
→TypeError: arqam.toWords: "x" is not a number in the form 1234.56 (digits, an optional ".", and "-" before or "%" after)
#Q422
Q423Are the error messages in English?Intermediate

Yes, for developers; show your users your own message.

#Q423
Q424Does an unknown currency code throw with strict?Advanced

Yes, with or without strict: a call with an unknown code is a TypeError.
A known code is taken in any letter case and with spaces around it.

(config() still accepts any code, as the page sets its own modes with it.)

arqam("5", {currency: " usd "})
→خمسة دولارات أمريكية
#Q424
Q425Can I check options without converting anything?Advanced

Call config() inside try … catch on an instance: it throws for a bad option.

(() => { try { arqam.createArqam().config({ierab: "x"}); return "ok"; } catch (e) { return e.message; } })()
→"arqamAR: ierab must be one of \"raf\" or \"r\", \"nasb\" or \"n\", \"jarr\" or \"j\", \"\" (got \"x\")"
#Q425

13.21 Units of measure and counted nouns (9)

Kilometres, spoons and any noun, through registerCurrency().

Q426How do I write a quantity of a unit, such as kilometres?Intermediate

Register the unit as a currency: the noun and its plural, and the minor unit if it has one.
A phrase such as «في الساعة» is a qualifier: it follows the number and is not declined.

arqam.registerCurrency("KMH", { // the number currDecimal: 3, // the names, without tashkeel majorSingle: "كيلومتر", majorPlural: "كيلومترات", minorSingle: "متر", minorPlural: "أمتار", qualifier: "في الساعة" }) && ""
→""
arqam("1", {currency: "KMH"})
→كيلومتر في الساعة
arqam("120", {currency: "KMH"})
→مائة وعشرون كيلومترًا في الساعة
#Q426
Q427How do I write «ملعقة شاي» (an iḍāfa)?Intermediate

idafa is the second term: it comes right after the noun.

arqam.registerCurrency("TSP", { // the number currDecimal: 0, openDecimals: true, // the names, without tashkeel majorSingle: "ملعقة", majorPlural: "ملاعق", majorGender: 1, // 1 = feminine idafa: "شاي" }) && ""
→""
arqam("1", {currency: "TSP"})
→ملعقة شاي
arqam("2", {currency: "TSP"})
→ملعقتا شاي
arqam("11", {currency: "TSP"})
→إحدى عشرة ملعقة شاي
#Q427
Q428How do I count any noun, such as books?Intermediate

Register it the same way; there is no limit to the nouns you can add.

arqam.registerCurrency("BOOK", {currDecimal: 0, majorSingle: "كتاب", majorPlural: "كتب"}) && ""
→""
arqam("1", {currency: "BOOK"})
→كتاب
arqam("3", {currency: "BOOK"})
→ثلاثة كتب
arqam("15", {currency: "BOOK"})
→خمسة عشر كتابًا
#Q428
Q429Where are the page's units of measure?Advanced

In the units add-on (arqam/units, or src/arqamUnits.js): the same 252 units the page uses, by their keys ("E01"), Intl names or Arabic names.
arqamUnits.options(key, number) gives the options of one conversion, the same as the page's own arqamUnitOptions(id, number) in js/arqamPageUnits.js.

arqam("12.5", arqamUnits.options("E01", "12.5"))
→اثنا عشر مترًا في الثانية، وخمسون سنتيمترًا في الثانية
#Q429
Q430Can a unit have open decimals?Advanced

openDecimals: true reads the decimals as given (as for cryptocurrencies).

arqam.registerCurrency("LTR", {currDecimal: 0, openDecimals: true, majorSingle: "لتر", majorPlural: "لترات"}) && ""
→""
arqam("2.75", {currency: "LTR"})
→لتران، وخمسة وسبعون جزءًا من المائة من اللتر
#Q430
Q431How do I write metres with centimetres?Intermediate

Register metre with the minor unit centimetre and 2 places.

arqam.registerCurrency("MTR", { // the number currDecimal: 2, // the names, without tashkeel majorSingle: "متر", majorPlural: "أمتار", minorSingle: "سنتيمتر", minorPlural: "سنتيمترات" }) && ""
→""
arqam("3.25", {currency: "MTR"})
→ثلاثة أمتار، وخمسة وعشرون سنتيمترًا
arqam("12.5", {currency: "MTR"})
→اثنا عشر مترًا، وخمسون سنتيمترًا
#Q431
Q432How do I write kilograms and grams?Intermediate

Three places for grams.

arqam.registerCurrency("KGM", { // the number currDecimal: 3, // the names, without tashkeel majorSingle: "كيلوغرام", majorPlural: "كيلوغرامات", minorSingle: "غرام", minorPlural: "غرامات" }) && ""
→""
arqam("2.5", {currency: "KGM"})
→كيلوغرامان، وخمسمائة غرام
#Q432
Q433How do I write days, months or years as a count?Intermediate

Register them as nouns; سنة is feminine.

arqam.registerCurrency("YRS", {currDecimal: 0, majorSingle: "سنة", majorPlural: "سنوات", majorGender: 1}) && ""
→""
arqam("3", {currency: "YRS"})
→ثلاث سنوات
arqam("11", {currency: "YRS"})
→إحدى عشرة سنةً
#Q433
Q434Can a unit have a symbol in the brackets?Advanced

Yes, with symbolNative or symbolLatin.

arqam.registerCurrency("KMT", {currDecimal: 0, majorSingle: "كيلومتر", majorPlural: "كيلومترات", symbolNative: "كم"}) && ""
→""
arqam("120", {currency: "KMT", brackets: "end", numSymbol: "symbol", currDecForce: "off"})
→مائة وعشرون كيلومترًا (120 كم)
#Q434

13.22 Words back to numbers (28)

The reader (arqamWordsToNumbers): words, dialects, finding numbers in text and checking documents.

Q435Can Arqam read Arabic words back into a number?Beginner

Yes, with the reader arqamWordsToNumbers.js (the module arqam/words).
Once it is loaded, arqam.fromWords() gives the number.

arqam.fromWords("ألفان وخمسمائة")
→"2500"
arqam.fromWords("مليون ونصف")
→"1500000"
#Q435
Q436How do I replace the number words in a sentence with figures?Beginner

Call the reader on the text; it replaces every number it finds.

wordsToNumbers("لدي ثلاثة وعشرون كتابا")
→لدي 23 كتابا
wordsToNumbers("دفعت ألفين وخمسمائة ريال وخمستاشر درهم")
→دفعت 2500 ريال و15 درهم
#Q436
Q437Can the reader read a date written in words?Beginner

Yes: a date in words, as toDate() writes it, becomes its figures, 18/11/2026م or 18/11/1447هـ.
Gregorian or Hijri comes from the era word (للميلاد، للهجرة …) or from the month.

wordsToNumbers("الثامن عشر من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد")
→18/11/2026م
wordsToNumbers("غرة شهر رمضان لعام ألف وأربعمائة وسبعة وأربعين")
→1/9/1447هـ
#Q437
Q438Can the reader read a time or a duration?Beginner

Yes: a time becomes the 24-hour clock (15:15) and a duration hours and minutes (2:30).

wordsToNumbers("الساعة الثالثة وخمس عشرة دقيقة عصرًا")
→"15:15"
wordsToNumbers("ساعتان ونصف")
→"2:30"
#Q438
Q439Why does a time come out as 3:15 and not 15:15?Intermediate

Without the part of the day (صباحًا، عصرًا، مساءً …) «الساعة الثالثة» can be morning or afternoon, so the reader gives the 12-hour clock and marks the item hour12: true.
With the part of the day, or in the 24-hour words (الخامسة عشرة), it gives 15:15.

JSON.stringify(wordsToNumbers.find("الساعة الثالثة وخمس عشرة دقيقة"))
→[{"start":0,"end":30,"text":"الساعة الثالثة وخمس عشرة دقيقة","value":"3:15","kind":"time","hour12":true}]
wordsToNumbers("الساعة الثالثة وخمس عشرة دقيقة مساءً")
→"15:15"
#Q439
Q440Will the reader take «المرة الثالثة» or «ساعة يد» for a time?Intermediate

No. An hour without «الساعة» is read as a time only with its minutes or the part of the day (الثالثة والنصف عصرًا), and «ساعة» or «دقيقة» alone stay words; a duration needs a number of hours or minutes (ساعتان، نصف ساعة، عشر دقائق).

wordsToNumbers("المرة الثالثة")
→المرة الثالثة
wordsToNumbers("ساعة يد")
→ساعة يد
wordsToNumbers("انتظرت عشر دقائق")
→انتظرت 0:10
#Q440
Q441What does find() give for a date or a time?Intermediate

One item for the whole phrase, with kind ("date", "time" or "duration"); a date also has calendar ("g" or "h") and iso (the Gregorian day, yyyy-mm-dd), and a time that can be morning or afternoon hour12: true.
Two dates joined by «الموافق» are two items.

JSON.stringify(wordsToNumbers.find("الثامن عشر من شهر ذي القعدة لعام ألف وأربعمائة وسبعة وأربعين"))
→[{"start":0,"end":60,"text":"الثامن عشر من شهر ذي القعدة لعام ألف وأربعمائة وسبعة وأربعين","value":"18/11/1447هـ","kind":"date","calendar":"h","iso":"2026-05-05"}]
#Q441
Q442How do I keep the 0.94 reading, with the year alone?Advanced

dates: "off" and times: "off": the year and the minutes are then read as plain numbers.

wordsToNumbers("الثامن عشر من شهر نوفمبر لعام ألفين وستة وعشرين", {dates: "off"})
→الثامن عشر من شهر نوفمبر لعام 2026
wordsToNumbers("الساعة الثالثة وخمس عشرة دقيقة", {times: "off"})
→الساعة الثالثة و15 دقيقة
#Q442
Q443Can I turn a date read from words back into words?Advanced

Yes: the value is in the figures toDate() reads, so the round trip gives the same day, in any style or calendar.

arqam.toDate(wordsToNumbers("الثامن عشر من شهر ذي القعدة لعام ألف وأربعمائة وسبعة وأربعين"), {calendar: "b", style: "compact"})
→18 ذي القعدة 1447هـ، الموافق 5 مايو 2026م
#Q443
Q444How do I find every number in a text, with its position?Intermediate

arqam.findNumbers(text) lists each number with its start, end, text, value and currency.

arqam.findNumbers("دفعت ألفين وخمسمائة ريال قطري أمس").map(x => [x.text, x.value, x.currency])
→[["ألفين وخمسمائة ريال قطري","2500","QAR"]]
#Q444
Q445How do I check that words say a given amount?Intermediate

With the reader loaded, arqam.verify(words, number, {currency: code}) reads the words back and compares them; reason says why they do not match, and «فقط … لا غير» and the figure in brackets are allowed around the words.

arqam.verify("خمسون ريالا قطريا", "50", {currency: "QAR"})
→{"ok":true,"reason":"match","read":"50","expected":"50","currency":"QAR","issue":"match","difference":"0","expectedWords":"خمسون ريالًا قطريًا"}
arqam.verify("خمسون ريالا قطريا", "40", {currency: "QAR"})
→{"ok":false,"reason":"different","read":"50","expected":"40","currency":"QAR","issue":"whole","difference":"10","expectedWords":"أربعون ريالًا قطريًا"}
#Q445
Q446Does the reader understand dialects and tashkeel?Intermediate

It reads common dialect forms (خمستاشر، ميتين) and ignores tashkeel and tatweel.

arqam.fromWords("خمستاشر")
→"15"
arqam.fromWords("أَلْفَانِ")
→"2000"
#Q446
Q447Can the reader give Arabic-Eastern digits?Intermediate

arabicNumbers: "on".

wordsToNumbers("لدي ثلاثة وعشرون كتابا", {arabicNumbers: "on"})
→لدي ٢٣ كتابا
#Q447
Q448Does it read the words the engine writes?Advanced

Yes, for every currency and option; the tests read back the engine's own words for random numbers in every form.

arqam.fromWords(arqam("987654321.5", {currency: "AED", tashkeel: "full"}))
→"987654321.5"
#Q448
Q449How does the reader handle the classical word order?Advanced

order: "auto" (the default) picks the order that reads the text as fewer numbers; "large" or "small" force one.

arqam.fromWords(arqam("1250", {wordOrder: "small"}))
→"1250"
#Q449
Q450Can it read ordinals and zero?Advanced

With ordinals: "on" and zero: "on".

wordsToNumbers("الفصل الحادي عشر", {ordinals: "on"})
→الفصل 11
wordsToNumbers("صفر", {zero: "on"})
→"0"
#Q450
Q451Can the reader write the currency as a code?Intermediate

currency: "code" writes the amount with the ISO code; "off" reads no currency.

wordsToNumbers("دفعت ألفين وخمسمائة ريال قطري", {currency: "code"})
→دفعت 2500.00 QAR
#Q451
Q452What does fromWords() return when there is no number?Beginner

null.

arqam.fromWords("لا شيء هنا")
→null
#Q452
Q453Does the reader read negatives and percentages?Intermediate

Yes.

wordsToNumbers("سالب خمسة")
→"-5"
wordsToNumbers("خمسة وعشرون بالمائة")
→"25%"
#Q453
Q454Does it read «ونصف» and «وربع»?Intermediate

Yes.

wordsToNumbers("مليار وربع")
→"1250000000"
arqam.fromWords("ألف ونصف")
→"1500"
#Q454
Q455Does it read the dialect forms of hundreds?Intermediate

Yes: ميتين، خمسمية …

wordsToNumbers("ميتين وخمسين")
→"250"
wordsToNumbers("ألفين وخمسمية")
→"2500"
#Q455
Q456How does the reader handle «ريال» alone?Intermediate

It reads the amount; the currency is null because several currencies are called ريال.
Pass the code to verify().

arqam.findNumbers("ألف ريال")[0].currency
→null
arqam.verify("ألف ريال", "1000", {currency: "SAR"}).ok
→true
#Q456
Q457Can I read with the long scale?Intermediate

scale: "long" reads بليون as 10¹².

wordsToNumbers("بليون", {scale: "long"})
→"1000000000000"
#Q457
Q458Can it read words that are also ordinary words?Intermediate

With ambiguous: "on" it also reads such words alone.

wordsToNumbers("مياه")
→مياه
wordsToNumbers("مياه", {ambiguous: "on"})
→"100"
#Q458
Q459What does verify() return when the words name no number?Advanced

ok false and reason "none".

arqam.verify("مرحبا", "5")
→{"ok":false,"reason":"none","read":null,"expected":"5","currency":null,"issue":"none","difference":null,"expectedWords":"خمسة"}
#Q459
Q460Does the reader find several numbers in one text?Advanced

Yes, each with its own place.

wordsToNumbers.find("عندي خمسة كتب وعشرون قلما").map(x => x.text + "=" + x.value).join(", ")
→خمسة=5, عشرون=20
#Q460
Q461Does fromWords() understand the classical order?Advanced

Yes.

wordsToNumbers("خمسون ومائتان وألف", {order: "small"})
→"1250"
#Q461
Q462Is «مائة وألف» 101,000 or 1,100?Advanced

Both readings are right Arabic.
The reader takes 101,000, the short form toWords() writes, so it always reads the engine's words back; order: "small" gives the classical 1,100.

Where the text itself shows the classical order (units before the hundreds), it is read that way.
legal: "auto" writes «مائة ألف وألف», which no reader can misread (manual 12.19).

wordsToNumbers("مائة وألف")
→"101000"
wordsToNumbers("مائة وألف", {order: "small"})
→"1100"
wordsToNumbers("اثنان وعشرون وتسعمائة وألف")
→"1922"
arqam("101000", {legal: "auto"})
→مائة ألف وألف
#Q462

13.23 Explaining the grammar (12)

arqamExplain: the case and the reason for every word.

Q463What does explain() give?Intermediate

For each word: the word, its value, its part (number, noun, adjective …), its case in one line (short), the reason (why) and the rules used.

arqam.explain("3", {currency: "USD"}).words.map(w => w.word + " — " + w.short).join(" | ")
→ثلاثة — مرفوع بالضمة الظاهرة، وهو مضاف | دولارات — مضاف إليه مجرور بالكسرة | أمريكية — نعت لـ«دولار» يتبعه (مجرور بالكسرة)
#Q463
Q464How do I load it?Intermediate

Load arqamExplain.js after the engine (or import arqam/explain); it adds arqam.explain() and arqam.explain.date().

import arqam from "arqam";
import "arqam/explain";       // attaches arqam.explain
arqam.explain("2000", {currency: "EGP", ierab: "nasb"});
#Q464
Q465Can it explain a date?Intermediate

arqam.explain.date(date, options), with the toDate() options.

arqam.explain.date("18/11/2026").words.slice(0, 3).map(w => w.word + " — " + w.short).join(" | ")
→الثامن — الجزء الأول من عدد ترتيبي مركب مبني على فتح الجزأين في محل رفع خبر لمبتدأ محذوف تقديره «اليومُ» | عشر — الجزء الثاني من عدد ترتيبي مركب مبني على الفتح | من — حرف جر مبني على السكون، لا محل له من الإعراب
#Q465
Q466Can it explain a time, a fraction or a range?Intermediate

Yes: arqam.explain.time(), arqam.explain.fraction() and arqam.explain.range(from, to, numberFormatOptions).

arqam.explain.range("9:00", "17:30", {style: "time"}).words.slice(0, 3).map(w => w.word + " — " + w.short).join(" | ")
→من — حرف جر مبني على السكون، وحُرّك بالفتح لالتقاء الساكنين، لا محل له من الإعراب | الساعة — مجرور بـ«من» وعلامة جره الكسرة الظاهرة | التاسعة — نعت لـ«الساعة» مجرور بالكسرة الظاهرة
#Q466
Q467Does explain() use the same words as toWords()?Advanced

Yes: text is exactly toWords() with the same options.

arqam.explain("1253.75", {currency: "MAD", tashkeel: "full"}).text === arqam("1253.75", {currency: "MAD", tashkeel: "full"})
→true
#Q467
Q468Is the explanation available for every tashkeel and case?Advanced

Yes; the words are explained with the marks you asked for, and the case follows ierab.

arqam.explain("2000", {currency: "QAR", ierab: "jarr", tashkeel: "full"}).words[0].short
→مجرور بالياء لأنه مثنى، وحُذفت نونه للإضافة
#Q468
Q469What is in each word of explain()?Intermediate

word, plain, part, value, short, why, rules and compare.

Object.keys(arqam.explain("5", {currency: "SAR"}).words[0]).join(", ")
→"word, plain, part, rules, short, why, compare, value"
#Q469
Q470What does compare give?Intermediate

Up to three forms of the same word in another count, gender or case, to show why this one was chosen.

arqam.explain("5", {currency: "AED"}).words[1].compare.map(c => c.join(": ")).join(" | ")
→ثلاثةُ ريالاتٍ: 3–10: جمع مجرور | ثلاثةَ عشرَ ريالًا: 11–99: مفرد منصوب | مائةُ ريالٍ: 100: مفرد مجرور
#Q470
Q471Can explain() explain an ordinal?Intermediate

Yes.

arqam.explain("21", {ordinal: "feminine"}).text
→الحادية والعشرون
#Q471
Q472What does explain() give for a bad number?Intermediate

text "" and empty lists.

arqam.explain("abc").text === "" && arqam.explain("abc").words.length
→0
#Q472
Q473How many grammar rules does explain know?Advanced

Every rule has an id, a title, a text and an example.

Object.keys(arqamExplain.rules).length
→61
#Q473
Q474Where is the reason for a word's form?Advanced

In why.

arqam.explain("5", {currency: "USD"}).words[0].why
→الأعداد 3–10 تخالف المعدود: «دولار» مذكر فجاء العدد بالتاء «خمسة».
#Q474

13.24 Performance and integration (18)

Speed, servers, spreadsheets, workers and accessibility.

Q475Is it fast enough for thousands of amounts?Beginner

Yes; a call takes microseconds on a current machine.
For large batches set the standing options once with config() and pass arrays.

Measure on your own machine:

arqam.config({currency: "QAR"});
const n = Array.from({length: 100000}, (_, i) => String(i * 7.25));
console.time("100k");
arqam(n);
console.timeEnd("100k");
#Q475
Q476How do I use it in a Node.js web service?Intermediate

Import it once and call it per request; pass options per call or use an instance per tenant.

import {toWords} from "arqam";
app.get("/words", (req, res) => {
  try { res.json({words: toWords(req.query.n, {currency: req.query.code, strict: "on"})}); }
  catch (e) { res.status(400).json({error: e.message}); }
});
#Q476
Q477How do I fill a column in Excel or Google Sheets?Intermediate

Convert the column in your program and write the words back (the page's batch mode does this with copy as two columns and CSV).
In Google Apps Script, paste the engine file into the project and call it from a custom function.

// Google Apps Script, after adding arqamAR.js to the project
function TAFQEET(amount, code) {
  return arqam(String(amount), {currency: code || "QAR"});
}
#Q477
Q478Can I use it in a Web Worker?Intermediate

Yes: it has no DOM access.
Import the module in the worker and post the words back.

// worker.js
import {toWords} from "./arqamAR.mjs";
onmessage = e => postMessage(toWords(e.data.n, e.data.options));
#Q478
Q479Does it work with server-side rendering?Intermediate

Yes. The words do not depend on the browser, so the server and the client give the same text.

#Q479
Q480How large is the library?Advanced

See the file sizes in dist/; the modules compress well (gzip or brotli on your server), and a bundler can minify them with your code.
Only load the reader and explain if you use them.

#Q480
Q481How do I make the words accessible to screen readers?Advanced

Set lang="ar" and dir="rtl" on the element.
Full tashkeel helps a screen reader pronounce the case endings correctly.

<span lang="ar" dir="rtl">${arqam(amount, {currency: "SAR", tashkeel: "full"})}</span>
#Q481
Q482How do I colour the parts of the words?Advanced

split: "on" adds markers between the parts (|p punctuation, |c currency, |f fraction, | groups) that you turn into HTML; 12.15 has a full function.

arqam("1234.5", {currency: "QAR", split: "on"})
→ألف|p و|مائتان وأربعة وثلاثون |cريالًا قطريًا|p، و|f||f|خمسون |cدرهمًا
#Q482
Q483Is there an English version?Advanced

Yes: arqam/en (arqamEN) writes numbers and amounts in English words.

#Q483
Q484How do I print a cheque or an invoice with the words?Intermediate

Put the words in your HTML template and use the browser's print (or a PDF library).
The page's «مستندات» mode does exactly this and can be used as an example.

document.querySelector(".cheque .words").textContent =
  arqam(amount, {currency: "AED", prefix: "فقط", suffix: "لا غير"});
window.print();
#Q484
Q485Can I use it in a form that updates as the user types?Beginner

Yes: it is fast enough to call on every key press.

input.addEventListener("input", () => {
  out.textContent = arqam(input.value.trim(), {currency: "EGP"});
});
#Q485
Q486How do I use it in Vue?Intermediate

Call it in a computed property.

const words = computed(() => toWords(amount.value, {currency: "MAD"}));
#Q486
Q487How do I use it in Angular?Intermediate

Wrap it in a pipe.

@Pipe({name: "tafqeet"})
export class TafqeetPipe implements PipeTransform {
  transform(v: string, code = "QAR") { return toWords(v, code); }
}
#Q487
Q488How do I use it in Svelte?Intermediate

Use a reactive statement.

<script>
  import {toWords} from "arqam";
  export let amount;
  $: words = toWords(amount, {currency: "SAR"});
</script>
<p dir="rtl">{words}</p>
#Q488
Q489Can I use it in a database or reporting tool?Intermediate

Any tool that runs JavaScript can call it; for SQL databases, convert in your application and store the words, or call a small service.

#Q489
Q490How do I cache results?Advanced

For repeated amounts a Map keyed on the number and options is enough, though the engine is already fast.

const cache = new Map();
const words = (n, code) => cache.get(n + code) ?? cache.set(n + code, toWords(n, code)).get(n + code);
#Q490
Q491Is it safe to call from many threads (worker_threads)?Advanced

Yes: each worker loads its own copy; there is no shared state.

#Q491
Q492How do I test my use of Arqam?Advanced

Compare with the words you expect, and with verify() for amounts.

assert.equal(toWords("50", {currency: "QAR"}), "خمسون ريالا قطريا");
assert.ok(verify(toWords(amount, {currency: "QAR"}), amount, {currency: "QAR"}).ok);
#Q492

13.25 Troubleshooting (16)

Quick answers to the most common surprises.

Q493The figure in brackets appears on the wrong side.Beginner

The element is left-to-right.
Add dir="rtl" to the element that shows the words.

#Q493
Q494I get «خمسة» instead of an amount in riyals.Beginner

The code is unknown or in lower case.
Codes are upper-case ISO codes.

arqam("5", {currency: "Qar"})
→خمسة ريالات قطرية
arqam("5", {currency: "QAR"})
→خمسة ريالات قطرية
#Q494
Q495The words have a tanween I do not want (ريالًا).Beginner
Q496My amount lost its last digits.Beginner

It was passed as a JavaScript number with more than about 16 digits, or with more decimals than the currency has.
Pass text, and use rounding if you want rounding.

arqam(123456789012345678, {currency: "EGP"})
→مائة وثلاثة وعشرون كوادرليونًا وأربعمائة وستة وخمسون تريليونًا وسبعمائة وتسعة وثمانون مليارًا واثنا عشر مليونًا وثلاثمائة وخمسة وأربعون ألفًا وستمائة وثمانون جنيهًا مصريًا
arqam("123456789012345678", {currency: "EGP"})
→مائة وثلاثة وعشرون كوادرليونًا وأربعمائة وستة وخمسون تريليونًا وسبعمائة وتسعة وثمانون مليارًا واثنا عشر مليونًا وثلاثمائة وخمسة وأربعون ألفًا وستمائة وثمانية وسبعون جنيهًا مصريًا
#Q496
Q497My options seem to be ignored after a while.Intermediate

Some other code may call reset() or config() on the global object.
Use your own instance from createArqam().

#Q497
Q498TypeScript says an option value is wrong.Intermediate

The value is not one the engine accepts; the declaration lists every accepted value as you type.
The engine would throw the same error at run time.

#Q498
Q499The reader returns null.Intermediate

The text has no number words it can read, or the words are ambiguous alone (for example «مياه»).
Pass a longer text or ambiguous: "on".

arqam.fromWords("مرحبا")
→null
#Q499
Q500The results differ between two machines.Advanced

They should not: the words do not depend on the machine.
Check that both use the same version (arqam.version) and the same options (arqam.options()).

arqam.version
→"1.85"
#Q500
Q501A time such as 3:15 is written «ليلا».Intermediate

Without am/pm, 3:15 is 03:15, which is at night.
Write "15:15", "3:15 pm" or "3:15 م" for the afternoon.

arqam.toTime("3:15")
→الساعة الثالثة وخمس عشرة دقيقةً فجرًا
arqam.toTime("15:15")
→الساعة الثالثة وخمس عشرة دقيقةً عصرًا
#Q501
Q502An ordinal comes back empty.Intermediate

Ordinals are whole numbers from 1 to 999,999.
Use strict to see the reason.

arqam("0", {ordinal: "masculine", strict: "on"})
→RangeError: arqam.toWords: an ordinal must be a whole number from 1 to 999,999
#Q502
Q503The page shows boxes or separate letters instead of Arabic.Beginner

The font has no Arabic letters, or the text is not marked as Arabic.
Use an Arabic font (for example Scheherazade, Amiri, Noto Naskh Arabic, Cairo) and lang="ar".

#Q503
Q504Copying the words gives extra characters.Beginner

If you coloured the words with layers, copy the plain text from toWords() instead of the drawn HTML.

#Q504
Q505The tanween colour does not show in Chrome.Intermediate

A span around a mark takes its letter's colour there.
Use the layer method of "Colouring the words and the tashkeel".

#Q505
Q506explain or fromWords is undefined.Intermediate

Load the explain or reader file after the engine (or import their modules).

#Q506
Q507The date is one day off.Intermediate

A Date object is read in the machine's time zone.
Pass the date as text ("2026-11-18") to avoid the time zone.

#Q507
Q508A registered currency disappeared.Advanced

It lasts for the session only; register it again when your program starts.

#Q508

13.26 The Intl-style formatter: NumberFormat (42)

arqam.NumberFormat: Intl.NumberFormat's way of working, in Arabic words; its styles, locales, options and errors, and the units add-on.

Q509What is arqam.NumberFormat?Beginner

A formatter in the style of JavaScript's Intl.NumberFormat: you make it once with a locale and options, then call format() for each number.
It writes Arabic words where Intl writes figures.

It calls the same methods as you would (toWords(), toFraction(), toTime(), toDate()), so the words are identical.

new arqam.NumberFormat("ar-QA", {style: "currency"}).format(1234.5)
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وخمسون درهمًا
arqam(1234.5, {currency: "AED"})
→ألف ومائتان وأربعة وثلاثون درهمًا إماراتيًا، وخمسون فلسًا
#Q509
Q510Do toWords() and the other methods still work?Beginner

Yes, all of them, unchanged.
NumberFormat is another way in for developers who know Intl; toWords() stays the shortest call for one number.

arqam(2500)
→ألفان وخمسمائة
arqam.NumberFormat().format(2500)
→ألفان وخمسمائة
#Q510
Q511Do I need to give a locale or write new?Beginner

No. With no locale the formatter uses "ar" (or the standing option locale); an object as the first argument is the options; new is optional, as with Intl.

arqam.NumberFormat().format(21)
→واحد وعشرون
arqam.NumberFormat({tashkeel: "full"}).format(21)
→وَاحِدٌ وَعِشْرُونَ
new arqam.NumberFormat("ar", {tashkeel: "full"}).format(21)
→وَاحِدٌ وَعِشْرُونَ
#Q511
Q512Which styles are there?Beginner

Eight: decimal (the default), percent, currency and unit as in Intl, and Arqam's own ordinal, fraction, time and date.

JSON.stringify(arqam.NumberFormat.styles)
→["decimal","percent","currency","unit","ordinal","fraction","time","date","dateTime"]
#Q512
Q513How do I write amounts with it?Beginner

Use style "currency".
The currency is the one of the locale's country (ar-QA: QAR, ar-SA: SAR, ar-AE: AED …), or the one you give with currency (or Arqam's code).

arqam.NumberFormat("ar-AE", {style: "currency"}).format(250)
→مائتان وخمسون درهمًا إماراتيًا
arqam.NumberFormat({currency: "EGP"}).format(3)
→ثلاثة جنيهات مصرية
#Q513
Q514Why does style "currency" with the locale "ar" give an error?Beginner

"ar" names no country, so there is no currency to take.
Give one, or a locale with a country, or set the standing locale once.

arqam.NumberFormat({style: "currency"})
→TypeError: arqam.NumberFormat: currency is required: give one ({style: "currency", currency: "QAR"}) or a locale with a country ("ar-QA")
arqam.config({locale: "ar-KW"})
arqam.NumberFormat({style: "currency"}).format(2)
→ديناران كويتيان
arqam.reset()
#Q514
Q515What does style "percent" do with 0.125?Intermediate

As in Intl, the number is a share of one: 0.125 is 12.5%.
It is worked out in text, so 0.07 is exactly 7% (in JavaScript 0.07 × 100 is 7.000000000000001).

A text that already ends in % is read as it is.

arqam.NumberFormat({style: "percent"}).format(0.125)
→ثلاثة عشر بالمائة
arqam.NumberFormat({style: "percent"}).format(0.07)
→سبعة بالمائة
arqam.NumberFormat({style: "percent"}).format("12.5%")
→اثنا عشر فاصلة خمسة بالمائة
#Q515
Q516How do I write units of measure?Intermediate

Load the units add-on (arqamUnits.js after arqamAR.js, or import "arqam/units"), then use style "unit" with an Intl unit name, an Arqam key or the Arabic name.

arqam.NumberFormat({style: "unit", unit: "liter"}).format(11)
→أحد عشر لترًا
arqam.NumberFormat({style: "unit", unit: "A05"}).format(3)
→ثلاثة كيلومترات
arqam.NumberFormat({style: "unit", unit: "قدم"}).format(2)
→قدمان
#Q516
Q517Which unit names does the add-on know?Intermediate

All 252 units of the page, by their key and Arabic name, and 140 Intl names such as kilometer, square-meter, kilometer-per-hour, liter-per-100-kilometer and celsius.

arqam.units.keys.length
→252
Object.keys(arqam.units.intl).length
→140
arqam.units.key("kilometer-per-hour")
→"E04"
#Q517
Q518How do I write ordinals, fractions, times and dates with it?Intermediate

With their styles; each one takes the options of its method.
For dates, toDate's own style option is called dateForm here, because style is the formatter's style.

arqam.NumberFormat({style: "ordinal", ordinal: "feminine"}).format(3)
→الثالثة
arqam.NumberFormat({style: "fraction", fractionForm: "parts"}).format("3/4")
→ثلاثة أجزاء من أربعة
arqam.NumberFormat({style: "time", timeParts: "on"}).format("13:45")
→الساعة الثانية إلا الربع ظهرًا
arqam.NumberFormat({style: "date", dateForm: "compact"}).format("2026-11-21")
→21 نوفمبر 2026م
#Q518
Q519How do I get the Hijri date or Arabic-Eastern numbers from the locale?Intermediate

As in Intl: -u-ca-islamic (or islamic-umalqura) gives the Hijri calendar, -u-nu-arab Arabic-Eastern numbers, with the Arabic separators ١٬٢٣٤٫٥٠.

arqam.NumberFormat("ar-SA-u-ca-islamic", {style: "date"}).format("2026-11-21")
→الحادي عشر من شهر جمادى الآخرة لعام ألف وأربعمائة وثمانية وأربعين للهجرة
arqam.NumberFormat("ar-QA-u-nu-arab", {style: "currency", brackets: "end"}).format(1234.5)
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وخمسون درهمًا (١٬٢٣٤٫٥٠ QAR)
#Q519
Q520Can I use the Intl option names and the Arqam names together?Intermediate

Yes: currency/code, currencyDisplay/numSymbol, numberingSystem/arabicNumbers, calendar (both value sets).
When both names of one option are given, Arqam's wins.

arqam.NumberFormat({currency: "QAR", currencyDisplay: "name", brackets: "end"}).format(3)
→ثلاثة ريالات قطرية (3.00 ريالات قطرية)
arqam.NumberFormat({currency: "USD", currency: "QAR"}).format(3)
→ثلاثة ريالات قطرية
#Q520
Q521How do I round to whole riyals?Intermediate

maximumFractionDigits rounds the number first (half away from zero, as Intl's halfExpand); roundingMode: "trunc" cuts instead.

arqam.NumberFormat("ar-QA", {style: "currency", maximumFractionDigits: 0}).format(12.5)
→ثلاثة عشر ريالًا قطريًا
arqam.NumberFormat("ar-QA", {style: "currency", maximumFractionDigits: 0, roundingMode: "trunc"}).format(12.5)
→اثنا عشر ريالًا قطريًا
#Q521
Q522Can I leave out the word «سالب»?Intermediate

signDisplay: "never" writes the number without its sign; "auto" and "negative" (the default) write «سالب».

arqam.NumberFormat({signDisplay: "never"}).format(-15)
→خمسة عشر
arqam.NumberFormat().format(-15)
→سالب خمسة عشر
#Q522
Q523Which Intl options are not taken?Intermediate

The ones that shape figures: useGrouping, notation, compactDisplay, minimumIntegerDigits, minimumFractionDigits, minimum/maximumSignificantDigits, roundingIncrement, roundingPriority, trailingZeroDisplay and currencySign.
They are refused with a RangeError, so a setting is never silently ignored.

arqam.NumberFormat({minimumFractionDigits: 2})
→RangeError: arqam.NumberFormat: minimumFractionDigits is an Intl option for figures; Arqam writes words and does not take it
#Q523
Q524What does resolvedOptions() give?Intermediate

The locale, the style and the options in force, with the readable names.
A formatter made again from it gives the same words.

JSON.stringify(arqam.NumberFormat("ar-QA-u-nu-arab", {style: "currency"}).resolvedOptions())
→{"locale":"ar-QA-u-nu-arab","style":"currency","roundingMode":"halfExpand","numberingSystem":"arab","arabicNumbers":"on","currency":"QAR"}
JSON.stringify(arqam.NumberFormat({style: "date", calendar: "hijri"}).resolvedOptions())
→{"locale":"ar","style":"date","calendar":"islamic-umalqura"}
#Q524
Q525Does a later config() change a formatter I already made?Intermediate

No. The standing options are read when the formatter is made, and it keeps them, as an Intl formatter never changes.
Make a new formatter to take new standing options.

var f = arqam.NumberFormat()
arqam.config({tashkeel: "full"})
f.format(3)
→ثلاثة
arqam.NumberFormat().format(3)
→ثَلَاثَةٌ
arqam.reset()
#Q525
Q526Can I pass the format function to map()?Intermediate

Yes. format is bound to its formatter, as in Intl, and an array gives an array.

JSON.stringify(["1", "2", "3"].map(arqam.NumberFormat({style: "ordinal", ordinal: "feminine"}).format))
→["الأولى","الثانية","الثالثة"]
#Q526
Q527Which locales does it take?Intermediate

Arabic only: "ar" or "ar-XX" with any extensions.
Another language is a RangeError; in a list the first Arabic locale is used.

supportedLocalesOf() filters a list.

JSON.stringify(arqam.NumberFormat.supportedLocalesOf(["fr", "ar-MA", "ar"]))
→["ar-MA","ar"]
arqam.NumberFormat("en-GB")
→RangeError: arqam.NumberFormat: Arqam writes Arabic only: use "ar" or "ar-XX" (got "en-GB")
#Q527
Q528When are the options checked?Advanced

When the formatter is made: an unknown option, a bad value or an option of another style throws then, not at the first format().

arqam.NumberFormat({style: "time", timeStyle: "atomic"})
→TypeError: arqam.toTime: timeStyle must be one of "common", "exact", "h24", "duration" (got "atomic")
arqam.NumberFormat({fractionForm: "parts"})
→TypeError: arqam.NumberFormat: fractionForm belongs to style "fraction" (this formatter has style "decimal")
#Q528
Q529Is a formatter slower than toWords()?Advanced

Making one costs about as much as createArqam(); each format() is one instance call (about 20 µs more than toWords()).
Make the formatter once and reuse it.

#Q529
Q530How do I import it with TypeScript?Advanced

The types are in dist/arqamAR.d.mts (and dist/arqamUnits.d.mts for the add-on): a misspelt style or option is a compile error.

import arqam, {NumberFormat, type ArqamNumberFormatOptions} from "arqam";
import "arqam/units";
const o: ArqamNumberFormatOptions = {style: "unit", unit: "kilometer", tashkeel: "full"};
const f = new NumberFormat("ar", o);
f.format(12.5);
#Q530
Q531Which npm package is it in?Advanced

The package arqam, version 2 (version 1.1.2 of the same name was an earlier library by the same author).
The engine's own version is in package.json, field arqamEngine, and in arqam.version.

arqam.version
→"1.85"
#Q531
Q532Which separators do Arabic-Eastern numbers use?Beginner

Arqam calls the two kinds of figures Arabic-Eastern numbers (٠١٢٣٤٥٦٧٨٩) and Arabic-Western numbers (0123456789).
Arabic-Eastern numbers use the Arabic separators unless you give sepDecimal or sepThousands:
Arabic decimal separator (٫ / U+066B): used in formal and typeset Arabic numbers, e.g. ٣٫١
Arabic thousands separator (٬ / U+066C): groups large numbers into thousands, e.g. ١٬٠٠٠٬٠٠٠

arqam("1000000.5", {currency: "USD", brackets: "end", arabicNumbers: "on"})
→مليون دولار أمريكي، وخمسون سنتًا (١٬٠٠٠٬٠٠٠٫٥٠ USD)
arqam.NumberFormat("ar-u-nu-arab", {brackets: "end"}).format(3.1)
→ثلاثة، وجزء من العشرة (٣٫١)
arqam("1000000.5", { currency: "EGP", brackets: "end", arabicNumbers: "on", sepThousands: ",", sepDecimal: "." })
→مليون جنيه مصري، وخمسون قرشًا (١,٠٠٠,٠٠٠.٥٠ EGP)
#Q532
Q533How do I get the words in labelled parts, like Intl's formatToParts()?Beginner

Call formatToParts() on the formatter.
It gives the words of format() as a list of {type, value}, in order; joined, the values give the format() text exactly.

Section 12.22 shows every style in colour.

arqam.NumberFormat({currency: "QAR"}).formatToParts(1250.5).map(p => p.type + ": " + p.value).join(" | ")
→integer: ألف | literal: و | integer: مائتان وخمسون | literal: | currency: ريالًا قطريًا | literal: ، و | fraction: خمسون | literal: | minorCurrency: درهمًا
#Q533
Q534Which types of part are there?Intermediate

The Intl names where Intl has one: integer, fraction, currency, unit, literal, minusSign, percentSign, decimal, day, month, year, era, hour, minute, second, dayPeriod.
Arqam's own: minorCurrency, minorUnit, denominator, ordinal, prefix, suffix and figure.

JSON.stringify(arqam.NumberFormat().formatToParts(1250.75).map(p => p.type))
→["integer","literal","integer","literal","fraction","literal","denominator"]
#Q534
Q535Why are scale words such as ألف not a part of their own?Intermediate

Each group of the number is one integer part with its scale word («خمسمائة ألف»), as Intl keeps a group of digits together.
The groups are separate parts, joined by literal parts («، و»).

arqam.NumberFormat({currency: "USD"}).formatToParts(2500000).filter(p => p.type === "integer").map(p => p.value).join(" | ")
→مليونان | خمسمائة ألف
#Q535
Q536How do I get the digits of the figure in brackets?Intermediate

The figure is one part of type figure; its parts list cuts it as Intl cuts figures: minusSign, integer, group, decimal, fraction, currency, literal.

JSON.stringify(arqam.NumberFormat({currency: "QAR", brackets: "end", arabicNumbers: "on"}).formatToParts(1250.5).pop().parts.map(p => p.value))
→["(","١","٬","٢٥٠","٫","٥٠"," ","QAR",")"]
#Q536
Q537Why does the minute part include «دقيقة»?Advanced

In Arabic the noun can carry the number itself («دقيقة» is one minute, «دقيقتان» two), so the number and its noun cannot always be cut apart.
So that every part has the same shape whatever the number, the minute and second parts (and the hours of a duration) are always the whole counted phrase.

Intl's minute part holds the number only; Arqam's differs on purpose.

arqam.NumberFormat({style: "time"}).formatToParts("15:02").map(p => p.type + ": " + p.value).join(" | ")
→literal: الساعة | hour: الثالثة | literal: و | minute: دقيقتان | literal: | dayPeriod: عصرًا
#Q537
Q538How do I write a range such as «من ألف إلى ألفي ريال»?Beginner

Call formatRange(start, end) on the formatter, with the smaller value first.
Section 12.23 shows every style in colour.

arqam.NumberFormat({currency: "QAR"}).formatRange(1000, 2000)
→من ألف ريال قطري إلى ألفي ريال قطري
#Q538
Q539Why does the second value read «ألفي» and not «ألفا»?Beginner

After «من» and «إلى» a value is in the genitive (مجرور), and the genitive of the dual is «ألفي».
Joining two format() calls by hand would keep the nominative; formatRange() writes the right case.

arqam.NumberFormat({currency: "QAR"}).formatRange(1, 2)
→من ريال قطري إلى ريالين قطريين
#Q539
Q540What if both values are the same?Beginner

You get one value, with no «من … إلى …»: the same words as format().
This also holds after rounding with maximumFractionDigits.

arqam.NumberFormat({currency: "QAR"}).formatRange(5, 5)
→خمسة ريالات قطرية
#Q540
Q541What if the start is larger than the end?Beginner

A RangeError, as in Intl.
Put the smaller value first.

arqam.NumberFormat().formatRange(10, 5)
→RangeError: arqam.NumberFormat: the start of a range must not be after its end (got 10 and 5)
#Q541
Q542Is the currency written once or with each value?Intermediate

With each value, so each one reads on its own, as contracts and cheques need.
A prefix and a suffix (فقط … لا غير) are written once, round the whole range, and the figure in brackets is one figure with a dash.

arqam.NumberFormat({currency: "QAR", prefix: "فقط", suffix: "لا غير", brackets: "end"}).formatRange(1000, 2000)
→فقط من ألف ريال قطري إلى ألفي ريال قطري لا غير (1,000.00–2,000.00 QAR)
#Q542
Q543How are date ranges written?Intermediate

Dates in one month write the month and year once; in one year, the year once; otherwise two full dates.
A range from «غرة» (option gora) keeps the month with it and the end day takes «منه»: «من غرة شهر نوفمبر إلى الخامس عشر منه».

With two calendars each date is written in full.

arqam.NumberFormat({style: "date"}).formatRange("2026-11-01", "2026-11-15")
→من الأول إلى الخامس عشر من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد
arqam.NumberFormat({style: "date"}).formatRange("2026-11-01", "2026-12-21")
→من الأول من شهر نوفمبر إلى الحادي والعشرين من شهر ديسمبر لعام ألفين وستة وعشرين للميلاد
arqam.NumberFormat({style: "date", gora: "on"}).formatRange("2026-11-01", "2026-11-15")
→من غرة شهر نوفمبر إلى الخامس عشر منه لعام ألفين وستة وعشرين للميلاد
#Q543
Q544Can I write a range of times or durations?Intermediate

Yes: style "time" gives «من الساعة … إلى الساعة …», and timeStyle "duration" gives «من ساعة ونصف إلى ساعتين …», each in the genitive.

arqam.NumberFormat({style: "time"}).formatRange("9:00", "17:30")
→من الساعة التاسعة صباحًا إلى الساعة الخامسة وثلاثين دقيقةً عصرًا
arqam.NumberFormat({style: "time", timeStyle: "duration"}).formatRange("1:30", "2:45")
→من ساعة ونصف إلى ساعتين وثلاثة أرباع
#Q544
Q545How do I tell the start value from the end value in the parts?Advanced

formatRangeToParts() gives each part a source: "startRange", "endRange" or "shared" (for «من», «إلى», a prefix, a suffix and the figure), as Intl does.

arqam.NumberFormat({currency: "QAR"}).formatRangeToParts(1000, 2000).map(p => p.source + ": " + p.value).join(" | ")
→shared: من | startRange: ألف | startRange: | startRange: ريال قطري | shared: إلى | endRange: ألفي | endRange: | endRange: ريال قطري
#Q545
Q546Does formatRange() change the words of toDate(), toTime() or toFraction()?Advanced

No. Those methods learnt the genitive for ranges, but use it only while formatRange() writes a value; called on their own they give the same words.

arqam.toTime("17:30")
→الساعة الخامسة وثلاثون دقيقةً عصرًا
arqam.NumberFormat({style: "time"}).formatRange("9:00", "17:30")
→من الساعة التاسعة صباحًا إلى الساعة الخامسة وثلاثين دقيقةً عصرًا
#Q546
Q547Do toParts() and the split colour marks still work?Advanced

Yes, unchanged.
toParts() gives the large pieces by name (prefix, sign, whole, fraction, suffix, figure); formatToParts() gives the fine pieces in order, in the Intl shape.

arqam.toParts("1250.5", {currency: "QAR"}).whole
→ألف ومائتان وخمسون ريالًا قطريًا
#Q547
Q548What does the style "dateTime" write?Intermediate

A date and its time in one sentence, as toDateTime() writes it; with a timeZone or a locale, the time of that place.

new arqam.NumberFormat({style: "dateTime"}).format("2026-11-27T16:30:00+03:00")
→السابع والعشرون من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد، الساعة الرابعة وثلاثون دقيقةً عصرًا
#Q548
Q549What does plan(x) give?Advanced

What format(x) will call, without calling it: {method, value, options}, the method of the engine (toWords, toDate, toTime …), the value it gets and every option.
arqamExplain uses it to explain what a formatter writes.

new arqam.NumberFormat({currency: "QAR"}).plan(5).method
→"toWords"
new arqam.NumberFormat({style: "date"}).plan("2026-11-27").method
→"toDate"
#Q549
Q550Does NumberFormat take unitDisplay and localeMatcher?Advanced

Yes, as Intl's names, so code written for Intl.NumberFormat keeps working.
unitDisplay takes "long" only: Arqam writes the unit's name in words (a short sign is refused, saying so).

localeMatcher is accepted and changes nothing: Arqam's locales are the Arabic ones it knows.

new arqam.NumberFormat({style: "unit", unit: "kilometer", unitDisplay: "long"}).format(3)
→ثلاثة كيلومترات
new arqam.NumberFormat({style: "unit", unit: "kilometer", unitDisplay: "short"}).format(3)
→RangeError: arqam.NumberFormat: unitDisplay: Arqam writes the unit's name in words ("long") (got "short")
new arqam.NumberFormat("ar-QA", {localeMatcher: "lookup"}).format(3)
→ثلاثة
#Q550

13.27 Approximate quantities (10)

approx: قرابة، ما يزيد على، أقلّ من، بضعة، نيّف — when the exact figure is not the point.

Q551How do I write «قرابة ألف ريال»?Beginner

Add approx: "about".
The number after «قرابة» is genitive (مضاف إليه), and «قرابة» itself takes the case of its place in the sentence (the ierab option).

arqam("1000", {currency: "QAR", approx: "about"})
→قرابة ألف ريال قطري
arqam("1000", {currency: "QAR", approx: "about", ierab: "nasb", tashkeel: "full"})
→قُرَابَةَ أَلْفِ رِيَالٍ قَطَرِيٍّ
#Q551
Q552Can I use «نحو», «زهاء» or «حوالَيْ» instead of «قرابة»?Beginner

Yes: approxWord is "qurabah" (the default), "nahw", "zuhaa" or "hawali".
All four put the number in the genitive.

arqam("20", {currency: "QAR", approx: "about", approxWord: "nahw"})
→نحو عشرين ريالًا قطريًا
arqam("100", {currency: "QAR", approx: "about", approxWord: "hawali", tashkeel: "full"})
→حَوَالَيْ مِائَةِ رِيَالٍ قَطَرِيٍّ
#Q552
Q553How do I write «ما يزيد على مليون ريال» or «أقل من مائة»?Beginner

Use "over" (ما يزيد على), "under" (أقلّ من), "atLeast" (ما لا يقل عن) or "atMost" (ما لا يزيد على).
The number after the preposition is genitive; before a word that starts with «ا» the preposition takes a kasra (مِنِ اثني عشر).

arqam("1000000", {currency: "QAR", approx: "over"})
→ما يزيد على مليون ريال قطري
arqam("12", {currency: "QAR", approx: "under", tashkeel: "full"})
→أَقَلُّ مِنِ اثْنَي عَشَرَ رِيَالًا قَطَرِيًّا
#Q553
Q554How do «بضعة» and «نيّف» work?Intermediate

"few" writes «بضع», an unstated number from three to nine, with the grammar of the numbers 3–9: the opposite gender of the counted noun, a compound with «عشر», joined to the tens.
"plus" writes «نيّف», one to nine above a round number, in the case of the units it stands for.

Give the number you mean; the engine chooses the form.

arqam("5", {currency: "TRY", approx: "few"})
→بضع ليرات تركية
arqam("15", {currency: "MAD", approx: "few"})
→بضعة عشر درهمًا مغربيًا
arqam("5000", {currency: "MAD", approx: "few"})
→بضعة آلاف درهم مغربي
arqam("25", {currency: "QAR", approx: "plus"})
→نيف وعشرون ريالًا قطريًا
arqam("103", {currency: "QAR", approx: "plus"})
→مائة ريال قطري ونيف
#Q554
Q555Why is the result empty for 150 with «بضعة»?Intermediate

«بضع» stands for three to nine, so 150 has no «بضع» form, and the call gives the isNaN value ("").
With strict: "on" it throws a RangeError that lists the numbers that fit.

Use "about" for any number.

arqam("150", {approx: "few"})
→""
arqam("150", {approx: "few", strict: "on"})
→RangeError: arqam.toWords: approx: "few" (بضع) is for 3 to 9 in the leading part of the number: 3-9, 13-19, 23-99 (not ending in 0, 1 or 2), times 1000, 1000000 …, or 300-900 (got 150)
arqam("150", {approx: "about"})
→قرابة مائة وخمسين
#Q555
Q556Why is there no figure in brackets with «بضعة»?Intermediate

An exact figure beside «بضعة آلاف» would contradict it, so "few" and "plus" leave it out.
"about", "over" and the others keep it.

arqam("5000", {currency: "SAR", approx: "few", brackets: "end"})
→بضعة آلاف ريال سعودي
arqam("1250.5", {currency: "SAR", approx: "about", brackets: "end"})
→قرابة ألف ومائتين وخمسين ريالًا سعوديًا، وخمسين هللةً (1,250.50 SAR)
#Q556
Q557Can Arqam round the number first?Intermediate

approxRound rounds to that many significant digits before the words are written: 987,450 with 1 becomes «قرابة مليون».

arqam("987450", {currency: "AED", approx: "about", approxRound: 1})
→قرابة مليون درهم إماراتي
arqam("987450", {currency: "AED", approx: "about", approxRound: 2})
→قرابة تسعمائة وتسعين ألف درهم إماراتي
#Q557
Q558How do I style «قرابة» on its own?Advanced

formatToParts() gives the approximate words as a part of type "approx", before the number or, for «ونيّف», after it.

arqam.NumberFormat({currency: "QAR", approx: "about"}).formatToParts(1000).map(p => p.type + ": " + p.value).join(" | ")
→approx: قرابة | literal: | integer: ألف | literal: | currency: ريال قطري
#Q558
Q559Does «اشرح» explain the approximate words?Advanced

Yes: «قرابة» with its case and «وهو مضاف», «ما» and «يزيد» in «ما يزيد على», «بضع» and «نيّف» with their own rules.

arqam.explain("1000", {currency: "QAR", approx: "about", ierab: "nasb"}).words.slice(0, 2).map(w => w.word + ": " + w.short).join(" | ")
→قرابة: منصوب وعلامة نصبه الفتحة الظاهرة، وهو مضاف | ألف: مضاف إليه مجرور بالكسرة الظاهرة، وهو مضاف
#Q559
Q560Can words back to numbers read them?Advanced

Yes, from reader 0.9.
«قرابة ألف ريال» gives 1000 with approx: "about".

«بضعة آلاف» and «نيّف وعشرون» have no single value, so they give value: null with min and max.

arqam.fromWords("قرابة ألف ريال قطري")
→"1000"
JSON.stringify(arqam.findNumbers("بضعة آلاف ريال").map(x => [x.approx, x.min, x.max]))
→[["few","3000","9000"]]
#Q560

13.28 Regions and time zones (12)

locale, timeZone, zoneName : the region's currency, month names and digits, and «بتوقيت الدوحة».

Q561How do I set Arqam up for Qatar (or any Arab country) in one line?Beginner

Give the locale once: config({locale: "ar-QA"}).
Every method then uses the region's month names, digits, separators and time zone, and an amount (style: "currency") its currency.

Options given later or in a call still win.

arqam("1500", {locale: "ar-QA", style: "currency"})
→ألف وخمسمائة ريال قطري
arqam.toDate("2026-11-24", {locale: "ar-IQ"})
→الرابع والعشرون من شهر تشرين الثاني لعام ألفين وستة وعشرين للميلاد
#Q561
Q562How do I write a time with «بتوقيت الدوحة»?Beginner

Give an exact moment (ISO text with Z or an offset, or a Date) and a locale or a timeZone.
The time is moved into the zone and named by its city.

arqam.toTime("2026-11-24T06:15:00Z", {locale: "ar-QA"})
→الساعة التاسعة وخمس عشرة دقيقةً صباحًا بتوقيت الدوحة
arqam.toTime("2026-11-24T06:15:00Z", {timeZone: "Asia/Qatar", zoneName: "both"})
→الساعة التاسعة وخمس عشرة دقيقةً صباحًا بتوقيت الدوحة (غرينتش ‎+3)
#Q562
Q563Can I name the country instead of the city?Beginner

Yes: zoneName: "country".
"offset" writes «بتوقيت غرينتش +3», "both" the city and the offset, "off" no zone.

arqam.toTime("2026-11-24T06:15:00Z", {locale: "ar-SA", zoneName: "country"})
→الساعة التاسعة وخمس عشرة دقيقةً صباحًا بتوقيت السعودية
arqam.toTime("2026-11-24T06:15:00Z", {locale: "ar-SA", zoneName: "both"})
→الساعة التاسعة وخمس عشرة دقيقةً صباحًا بتوقيت مكة المكرمة (غرينتش ؜+٣)
#Q563
Q564Where do names such as "Asia/Qatar" come from, and does Arqam need updating when a country changes its clocks?Intermediate

From the IANA Time Zone Database, which every browser and Node.js carry.
Arqam only reads it, so summer time and new rules arrive with the browser's own updates.

Arqam carries only the Arabic names.

arqam.toTime("2026-07-15T12:00:00Z", {locale: "ar-EG", zoneName: "both"})
→الساعة الثالثة عصرًا بتوقيت القاهرة (غرينتش ؜+٣)
#Q564
Q565Why is my time not moved or named?Intermediate

Only an exact moment is moved: ISO with Z or an offset, or a Date.
A plain "21:01" or "2026-11-24T06:15" has no zone, so it is written as typed.

Without a locale or a timeZone a moment is written as written, and named only when you give zoneName.

arqam.toTime("21:01", {locale: "ar-QA"})
→الساعة التاسعة ودقيقة مساءً
arqam.toTime("2026-11-23T22:30:00+03:00")
→الساعة العاشرة وثلاثون دقيقةً مساءً
arqam.toTime("2026-11-23T22:30:00+03:00", {zoneName: "offset"})
→الساعة العاشرة وثلاثون دقيقةً مساءً بتوقيت غرينتش ‎+3
#Q565
Q566How do I write the date and the time together?Intermediate

toDateTime() writes the date, «، », the time and the zone.
It takes the options of toDate and of toTime.

arqam.toDateTime("2026-11-23T19:30:00Z", {timeZone: "Asia/Qatar"})
→الثالث والعشرون من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد، الساعة العاشرة وثلاثون دقيقةً مساءً بتوقيت الدوحة
#Q566
Q567Can I add my own name for a zone?Intermediate

Yes: registerTimeZone(zone, name) gives any IANA zone an Arabic name, or replaces a built-in one; null takes it away.

arqam.toTime("2026-11-24T06:15:00Z", {timeZone: "America/Denver"})
→الساعة الحادية عشرة وخمس عشرة دقيقةً مساءً بتوقيت غرينتش ‎−7
(arqam.registerTimeZone("America/Denver", "دنفر"), arqam.toTime("2026-11-24T06:15:00Z", {timeZone: "America/Denver"}))
→الساعة الحادية عشرة وخمس عشرة دقيقةً مساءً بتوقيت دنفر
#Q567
Q568Why does toWords write no riyals after config({locale: "ar-QA"})?Advanced

As in Intl, a locale does not make a number an amount: give style: "currency" and the region's currency comes with it, or give the currency itself.

arqam("5", {locale: "ar-QA"})
→خمسة
arqam("5", {locale: "ar-QA", style: "currency"})
→خمسة ريالات قطرية
#Q568
Q569Which digits and separators does each locale use?Advanced

Arabic-Eastern numbers in eight locales: ar-EG, ar-IQ, ar-JO, ar-PS, ar-SA, ar-SD, ar-SY and ar-YE; Arabic-Western in the other fourteen, and with a bare "ar".
Libya, Tunisia, Algeria and Morocco write 1.234,5.

arabicNumbers ("eastern" or "western"; "on" or "off"), -u-nu-arab or -u-nu-latn in the locale, sepDecimal and sepThousands override them.

arqam("1500.5", {locale: "ar-SA", style: "currency", brackets: "end"})
→ألف وخمسمائة ريال سعودي، وخمسون هللةً (١٬٥٠٠٫٥٠ SAR)
arqam("1500.5", {locale: "ar-KW", style: "currency", brackets: "end"})
→ألف وخمسمائة دينار كويتي، وخمسمائة فلس (1,500.500 KWD)
arqam("1500.5", {locale: "ar-MA", style: "currency", brackets: "end"})
→ألف وخمسمائة درهم مغربي، وخمسون سنتيمًا (1.500,50 MAD)
#Q569
Q570What happens with a wrong zone name such as "Asia/Doha"?Advanced

A RangeError that suggests the right name.
Qatar's zone is "Asia/Qatar".

arqam.toTime("2026-11-24T06:15:00Z", {timeZone: "Asia/Doha"})
→RangeError: arqamAR: unknown time zone "Asia/Doha" (did you mean "Asia/Qatar"?)
#Q570
Q571Why is there an invisible character before +3 in «غرينتش +3»?Intermediate

The offset carries a direction mark before its sign, as CLDR writes signed numbers in Arabic: LRM (U+200E) with Arabic-Western numbers, so "+3" and "−7" stay whole and do not show as "3+" inside Arabic text; ALM (U+061C) with Arabic-Eastern numbers.
The mark takes no space.

To compare text, remove it: s.replace(/[\u200E\u061C]/g, "").

[...arqam.toTime("2026-11-24T06:15:00Z", {timeZone: "Asia/Qatar", zoneName: "offset"})].slice(-3).map(c => "U+" + c.codePointAt(0).toString(16).toUpperCase().padStart(4, "0")).join(" ")
→"U+200E U+002B U+0033"
#Q571
Q572Can the Arqam page use my country's currency, month names and time?Beginner

Yes: the chip «المنطقة» at the top of the page (section 5.14).
One of the 22 Arab countries sets the currency, month names, digits, separators and the time zone of a date with a time.

A value you change yourself is kept and tagged «يدويًا».
The choice is saved in the browser.

#Q572

13.29 One name: arqam (7)

arqam(...), a currency alone, «واحد/اثنان» after the noun, and what changed in engine 1.80.

Q573Can I call arqam(...) directly?Beginner

Yes. arqam(n, locales, options) is arqam.toWords(n, locales, options), made at each call like Intl's new NumberFormat(locales, options).format(n).
The locale chooses the language; the options are those of 12.10.

arqam("1234.56", {currency: "QAR"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا
arqam("1234.56", "en", {currency: "QAR"})
→"One Thousand Two Hundred Thirty-Four Qatari Riyals and Fifty-Six Dirhams"
arqam("1234.56")
→ألف ومائتان وأربعة وثلاثون، وستة وخمسون جزءًا من المائة
#Q573
Q574Does arqam(...) use what I set with arqam.config()?Beginner

Yes. arqam(...) is arqam.toWords(...), so config() applies to it as to every method; options given in the call win.

arqam.config({currency: "QAR", tashkeel: "alif"});
arqam("1234.56");                       // the riyals with the alif tanween
arqam("1234.56", {tashkeel: "none"});   // the call wins
arqam.reset();
#Q574
Q575Why is arqam("1234.56", "QAR") an error?Beginner

The second argument is the locale (as in Intl), and "QAR" is not a language.
Give the currency as an option: {currency: "QAR"}.

arqam("1234.56", "QAR")
→RangeError: arqam: "QAR" is a currency, not a locale: give it in the options, {currency: "QAR"}
arqam("1234.56", {currency: "QAR"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا
#Q575
Q576Do I need style: "currency" with a currency?Beginner

No. A currency on its own makes the number an amount (style: "currency" is understood).
currency: "" writes a plain number.

A locale alone does not make an amount, as in Intl; give style: "currency" to take the region's currency.

arqam("1234.56", {currency: "QAR"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا
arqam("1234.56", {currency: ""})
→ألف ومائتان وأربعة وثلاثون، وستة وخمسون جزءًا من المائة
arqam("1234.56", {locale: "ar-QA", style: "currency"})
→ألف ومائتان وأربعة وثلاثون ريالًا قطريًا، وستة وخمسون درهمًا
#Q576
Q577Why does 2 riyals give «ريالان قطريان» without «اثنان»?Beginner

The dual already says two, as the singular says one, so by default the number is not written after the noun.
In the legal form and the cheque form («فقط … لا غير») it is written, so that the amount cannot be altered.

emphasisOneTwo: "on" writes it always and "off" never.

arqam("2", {currency: "QAR"})
→ريالان قطريان
arqam("2", {currency: "QAR", prefix: "فقط", suffix: "لا غير"})
→فقط ريالان قطريان اثنان لا غير
arqam("2", {currency: "QAR", legal: "auto"})
→ريالان قطريان اثنان
arqam("1", {currency: "QAR", emphasisOneTwo: "on"})
→ريال قطري واحد
#Q577
Q578Can the reader read «ريالان قطريان» back without a number word?Beginner

Yes (reader 0.97).
A counted noun alone is read as its number: the singular as one and the dual as two, for the currency and for its minor unit, at the start of the text or after «و».

arqam.fromWords("ريالان قطريان")
→"2"
arqam.fromWords("مائة ريال قطري ودرهمان")
→"100.02"
#Q578
Q579Where has maxZeros gone?Beginner

It was removed in engine 1.80.
There is no limit on the number of zeros; the words are as long as the number needs.

An unknown option is an error that names it.

arqam("1" + "0".repeat(30))
→نونليون
#Q579