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.
1,250.75 SAR · Saudi riyal
ألف ومائتان وخمسون ريالًا سعوديًا، وخمس وسبعون هللةً
Arabic number-to-words (tafqeet) for amounts, numbers, units, ordinals and dates — Arqam 2.0.0 — Mohsen Alyafei
Popular tasks
Website: arqampro.net · Source code: GitHub (MohsenAlyafei/arqamAR) · npm: arqam · Playground
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:
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:
- صيغ أخرى (other forms): the same amount with full tashkeel (or without it), as a cheque line («فقط … لا غير» with the figure), and in the other reading order, each with a copy button.
- The read-back tick: «✓ تُقرأ الكلمات: 1,234.56». The words are read back into a number and the tick shows when they give the number typed (when extra decimals were cut it says so). It is not shown for percentages, units, ordinals and dates.
2.3 «مستندات» (Documents): the amount in a document
Type the amount and choose the currency, then a template:
- شيك (cheque): bank, date, «ادفعوا لأمر», «مبلغًا وقدره …» on ruled lines, the figure in a box, the cheque number and the signature line.
- فاتورة (invoice): number, date, client, item, total and «المبلغ بالحروف».
- بند عقد (contract clause): «المادة الخامسة: قيمة العقد» (the clause number is written as a word), then «اتفق الطرفان على أن تكون القيمة الإجمالية لهذا العقد مبلغًا وقدره …».
- سند قبض (receipt): «استلمنا من السيد/السادة», «مبلغًا وقدره», «وذلك عن» and two signature lines.
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 need | Arqam | Example |
|---|---|---|
| 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 number | any 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 word | every word with its إعراب, the reason and the rule: arqam/explain | 1,250.75 QAR: ومائتان — الواو حرف عطف؛ معطوف مرفوع بالألف لأنه مثنى وخمسون — الواو حرف عطف؛ معطوف مرفوع بالواو لأنه ملحق بجمع المذكر السالم ريالًا — تمييز منصوب بالفتحة الظاهرة |
| Words back to numbers | arqam/words: dialect words too, and verify() checks words against their figure | → 1250.75ألف ومئتان وخمسون ريالًا وخمس وسبعون درهمًا dialect → 3500ثلاثة آلاف وخمسمية |
| Legal form for cheques and contracts | option legal | 302,000 (the default, auto) ثلاثمائة ألف وألفان 302,000, legal: "none"ثلاثمائة وألفان |
| The words in parts, for separate fields | formatToParts(): the number, the decimals, the currency and the sub-unit, each labelled | 1,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 من الحادي والعشرين من شهر جمادى الأولى إلى الخامس من شهر جمادى الآخرة لعام ألف وأربعمائة وثمانية وأربعين للهجرة |
| Tests | seventy-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.
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
- Choose تحويل رقم (Single) and عملات (Currencies) in the work row.
- Type the amount, for example
1250.75. Thousands separators are not needed. - Pick the currency in the menu: type its name or code (
QAR) in the menu's search box. - Tick قبل (before) and بعد (after) to add فقط and لا غير.
- 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"})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
- Choose التاريخ (Date) in the work row.
- Type the date as day/month/year, for example
25/11/2026, or pick it in the calendar. - 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
- For a time, choose الوقت (Time) and type it as
15:45or3:45 م. - For a fraction, type it in the number box:
3 1/2,3½or3/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
- Choose أعداد ترتيبية (Ordinals) in the work row.
- Choose masculine or feminine, and with or without ال in the list next to it.
- 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
- Choose وحدات قياس (Other units) in the work row.
- Pick the unit in its menu (type part of its name to find it).
- 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
- Choose تحويل دفعة (Batch).
- 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. - 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
- In the options, choose Tashkeel: none, the endings only, or full.
- 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
- In «سريع» (Quick), type or paste the words: the line below the examples says كلمات ← أرقام.
In code
arqam.fromWords("ألف ومائتان وخمسون ريالا قطريا")arqam.findNumbers("دفع خمسة وعشرين دينارا كويتيا وثلاثمائة فلس")start | 4 |
end | 43 |
text | خمسة وعشرين دينارا كويتيا وثلاثمائة فلس |
value | "25.3" |
currency | "KWD" |
noun | دينارا كويتيا |
places | 3 |
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:
- Arabic-Western and Arabic-Eastern numbers (١٢٣٤٫٥٦), thousands separators (1,234.56 or 1 234,56).
- Negatives:
-250or250-→ the word «سالب» before the words. - Percentages:
12.05%→ «اثنا عشر فاصلة صفر خمسة بالمائة». - Any number of decimal places; digits beyond the currency's places are cut, not rounded (see the rounding option).
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:
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
4.2 Numbers only
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:
4.4 Ordinals
First, second… up to 999,999, with masculine (البند، الملحق) or feminine (المادة، الفقرة).
From 101 upwards: «الخامس والعشرون بعد المائة».
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.
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.

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.
| Language code | Locale | Month names | Default long date | Month type | Default numbers | In Arqam |
|---|---|---|---|---|---|---|
ar | Arabic (ar) | يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر | ٢٧ يناير ٢٠٢٢ | Gregorian months English | Arabic-Eastern | months: "gulf" |
ar-001 | Arabic (World) | يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر | ٢٧ يناير ٢٠٢٢ | Gregorian months English | Arabic-Eastern | months: "gulf" |
ar-AE | Arabic (UAE) | يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر | ٢٧ يناير ٢٠٢٢ | Gregorian months English | Arabic-Eastern | months: "gulf" |
ar-BH | Arabic (Bahrain) | يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر | ٢٧ يناير ٢٠٢٢ | Gregorian months English | Arabic-Eastern | months: "gulf" |
ar-DJ | Arabic (Djibouti) | يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر | ٢٧ يناير ٢٠٢٢ | Gregorian months English | Arabic-Eastern | months: "gulf" |
ar-DZ | Arabic (Algeria) | جانفي، فيفري، مارس، أفريل، ماي، جوان، جويلية، أوت، سبتمبر، أكتوبر، نوفمبر، ديسمبر | 27 جانفي 2022 | Gregorian months French | Arabic-Western | months: "maghreb" |
ar-EG | Arabic (Egypt) | يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر | ٢٧ يناير ٢٠٢٢ | Gregorian months English | Arabic-Eastern | months: "gulf" |
ar-EH | Arabic (Western Sahara) | يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر | 27 يناير 2022 | Gregorian months English | Arabic-Western | months: "gulf" |
ar-ER | Arabic (Eritrea) | يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر | ٢٧ يناير ٢٠٢٢ | Gregorian months English | Arabic-Eastern | months: "gulf" |
ar-IL | Arabic (Israel) | يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر | ٢٧ يناير ٢٠٢٢ | Gregorian months English | Arabic-Eastern | months: "gulf" |
ar-IQ | Arabic (Iraq) | كانون الثاني، شباط، آذار، نيسان، أيار، حزيران، تموز، آب، أيلول، تشرين الأول، تشرين الثاني، كانون الأول | ٢٧ كانون الثاني ٢٠٢٢ | Assyrian Months | Arabic-Eastern | months: "levant" |
ar-JO | Arabic (Jordan) | كانون الثاني، شباط، آذار، نيسان، أيار، حزيران، تموز، آب، أيلول، تشرين الأول، تشرين الثاني، كانون الأول | ٢٧ كانون الثاني ٢٠٢٢ | Assyrian Months | Arabic-Eastern | months: "levant" |
ar-KM | Arabic (Comoros) | يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر | ٢٧ يناير ٢٠٢٢ | Gregorian months English | Arabic-Eastern | months: "gulf" |
ar-KW | Arabic (Kuwait) | يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر | ٢٧ يناير ٢٠٢٢ | Gregorian months English | Arabic-Eastern | months: "gulf" |
ar-LB | Arabic (Lebanon) | كانون الثاني، شباط، آذار، نيسان، أيار، حزيران، تموز، آب، أيلول، تشرين الأول، تشرين الثاني، كانون الأول | ٢٧ كانون الثاني ٢٠٢٢ | Assyrian Months | Arabic-Eastern | months: "levant" |
ar-LY | Arabic (Libya) | يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر | 27 يناير 2022 | Gregorian months English | Arabic-Western | months: "gulf" |
ar-MA | Arabic (Morocco) | يناير، فبراير، مارس، أبريل، ماي، يونيو، يوليوز، غشت، شتنبر، أكتوبر، نونبر، دجنبر | 27 يناير 2022 | Gregorian months English Variant | Arabic-Western | months: "morocco" |
ar-MR | Arabic (Mauritania) | يناير، فبراير، مارس، إبريل، مايو، يونيو، يوليو، أغشت، شتمبر، أكتوبر، نوفمبر، دجمبر | ٢٧ يناير ٢٠٢٢ | Gregorian months English Variant | Arabic-Eastern | not offered (إبريل، أغشت، شتمبر، دجمبر) |
ar-OM | Arabic (Oman) | يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر | ٢٧ يناير ٢٠٢٢ | Gregorian months English | Arabic-Eastern | months: "gulf" |
ar-PS | Arabic (Palestine) | كانون الثاني، شباط، آذار، نيسان، أيار، حزيران، تموز، آب، أيلول، تشرين الأول، تشرين الثاني، كانون الأول | ٢٧ كانون الثاني ٢٠٢٢ | Assyrian Months | Arabic-Eastern | months: "levant" |
ar-QA | Arabic (Qatar) | يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر | ٢٧ يناير ٢٠٢٢ | Gregorian months English | Arabic-Eastern | months: "gulf" |
ar-SA | Arabic (Saudi Arabia) | محرم، صفر، ربيع الأول، ربيع الآخر، جمادى الأولى، جمادى الآخرة، رجب، شعبان، رمضان، شوال، ذو القعدة، ذو الحجة | جمادى الآخرة ١٤٤٣ هـ | Hijri Months | Arabic-Eastern | calendar: "h" |
ar-SD | Arabic (Sudan) | يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر | ٢٧ يناير ٢٠٢٢ | Gregorian months English | Arabic-Eastern | months: "gulf" |
ar-SO | Arabic (Somalia) | يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر | ٢٧ يناير ٢٠٢٢ | Gregorian months English | Arabic-Eastern | months: "gulf" |
ar-SS | Arabic (South Sudan) | يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر | ٢٧ يناير ٢٠٢٢ | Gregorian months English | Arabic-Eastern | months: "gulf" |
ar-SY | Arabic (Syria) | كانون الثاني، شباط، آذار، نيسان، أيار، حزيران، تموز، آب، أيلول، تشرين الأول، تشرين الثاني، كانون الأول | ٢٧ كانون الثاني ٢٠٢٢ | Assyrian Months | Arabic-Eastern | months: "levant" |
ar-TD | Arabic (Chad) | يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر | ٢٧ يناير ٢٠٢٢ | Gregorian months English | Arabic-Eastern | months: "gulf" |
ar-TN | Arabic (Tunisia) | جانفي، فيفري، مارس، أفريل، ماي، جوان، جويلية، أوت، سبتمبر، أكتوبر، نوفمبر، ديسمبر | 27 جانفي 2022 | Gregorian months French | Arabic-Western | months: "maghreb" |
ar-YE | Arabic (Yemen) | يناير، فبراير، مارس، أبريل، مايو، يونيو، يوليو، أغسطس، سبتمبر، أكتوبر، نوفمبر، ديسمبر | ٢٧ يناير ٢٠٢٢ | Gregorian months English | Arabic-Eastern | months: "gulf" |

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.
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.
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)
Fatha tanween on the alif writes «ريالاً» instead of «ريالًا»:
5.2 Ierab (grammatical case)
5.3 Miscellaneous
- Compact mode (press style): groups as figures, scale words in letters; one and two stay as words (ريال قطري واحد، ريالان قطريان): 1234567.56→مليون، و234 ألفا، و567 ريالا قطريا، و56 درهما
- Comma between words: the Arabic comma before the و between groups; switched off: 1234.56→ألف ومائتان وأربعة وثلاثون ريالا قطريا، وستة وخمسون درهما
- Ma'ah / Miah: 300→ثلاثمائة/300→ثلاثمئة
- Miah split: 300→ثلاث مائة
- Add the word "zero" for numbers below one: 0.5→صفر، وخمسة أجزاء من العشرة
- Arabic-Eastern numbers in the bracketed figure: 1234.56→ألف، ومائتان وأربعة وثلاثون ريالا قطريا، وستة وخمسون درهما (١,٢٣٤.٥٦ QAR)
- Ignore decimal parts: 1234.56→ألف، ومائتان وأربعة وثلاثون ريالا قطريا
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.
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.
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:
5.6 Currency options
- Without the country name: 1234.56→ألف، ومائتان وأربعة وثلاثون ريالا، وستة وخمسون درهما
- Fixed phrase after a unit: some units carry a fixed phrase that is never declined, such as «في الثانية» or «شاي». It follows the number word and is repeated after the minor unit: متر واحد في الثانية، وخمسون سنتيمترًا في الثانية.
5.7 Numbering system (scale)
The difference starts at a thousand million:
5.8 Decimal formats (numbers only)
«من المائة» without the definite article:
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:
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 («سنة ست وعشرين وألفين»).
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.
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.
6. Batch conversion
6.1 Input
- One number per line. An empty line stays empty in the output so it pastes into Excel with the same alignment.
- A currency code on a line applies to that line:
1250.5 KWDorKWD 1250.5; otherwise the currency chosen at the top is used. - A table from Excel: copy the cells and paste. The amount column and the currency-code column are detected automatically; if the first row has no amount it is treated as the header and its names are used; every other column (invoice number, supplier…) passes through to the output unchanged.
- A CSV, TSV or text file: the "فتح ملف…" (Open file) button, or drag the file onto the input box. Quotes and the commas inside them are honoured.
| Input line | Output 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:
- نص فقط Text only: one line of words per input line (the original behaviour).
- عدد + نص Number + text.
- فاتورة Invoice: amount, words, currency name, ISO code, numeric value.
- محاسبة Accounting: Value, Currency, Words.
- مخصص… Custom: tick the columns yourself (also the amount in Arabic-Eastern numbers and the currency symbol).
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
- نسخ Copy: the words with their colours.
- ▾ نسخ صورة Copy as image: a PNG of the words in colour, for WhatsApp, Teams and mail where Arabic fonts may be missing. If the browser does not allow images on the clipboard the image is downloaded instead.
- ▾ تنزيل صورة Download image: the file
arqam-<number>.png.
Batch
- نسخ Copy: the chosen columns, tab-separated; pastes straight into Excel columns.
- ▾ الأعمدة مع صف العناوين Columns with a header row.
- ▾ النص فقط Text only: the words, one line per number.
- ▾ عمود العدد وعمود النص Number column and words column.
- ▾ تنزيل CSV Download CSV: the chosen columns with a header row, encoded so Excel shows Arabic correctly.
- ▾ تنزيل Excel Download Excel: a real
.xlsx, right-to-left sheet, Value column as numbers.
A small message at the bottom of the screen confirms every copy and download.
8. Recent conversions, search, dark mode
- Recent: the latest conversions under the words panel; "استخدام" (use) restores the number and its options; the list can be cleared.
- Dark mode (داكن) is remembered; the words panel stays light because the word colours are designed for a light background.
- Phone: the options panel opens from the button at the bottom, the currency menu opens as a search window, and the conversion-type row scrolls sideways.
- Keys: Esc closes menus and windows.
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
| Number | Plain | With tashkeel |
|---|---|---|
| 0 | صفر | صِفْرٌ |
| 1 | واحد | وَاحِدٌ |
| 2 | اثنان | اثْنَانِ |
| 3 | ثلاثة | ثَلَاثَةٌ |
| 4 | أربعة | أَرْبَعَةٌ |
| 5 | خمسة | خَمْسَةٌ |
| 6 | ستة | سِتَّةٌ |
| 7 | سبعة | سَبْعَةٌ |
| 8 | ثمانية | ثَمَانِيَةٌ |
| 9 | تسعة | تِسْعَةٌ |
| 10 | عشرة | عَشْرَةٌ |
10.2 11 to 19
| Number | Plain | With tashkeel |
|---|---|---|
| 11 | أحد عشر | أَحَدَ عَشَرَ |
| 12 | اثنا عشر | اثْنَا عَشَرَ |
| 13 | ثلاثة عشر | ثَلَاثَةَ عَشَرَ |
| 14 | أربعة عشر | أَرْبَعَةَ عَشَرَ |
| 15 | خمسة عشر | خَمْسَةَ عَشَرَ |
| 16 | ستة عشر | سِتَّةَ عَشَرَ |
| 17 | سبعة عشر | سَبْعَةَ عَشَرَ |
| 18 | ثمانية عشر | ثَمَانِيَةَ عَشَرَ |
| 19 | تسعة عشر | تِسْعَةَ عَشَرَ |
10.3 20 to 29
| Number | Plain | With tashkeel |
|---|---|---|
| 20 | عشرون | عِشْرُونَ |
| 21 | واحد وعشرون | وَاحِدٌ وَعِشْرُونَ |
| 22 | اثنان وعشرون | اثْنَانِ وَعِشْرُونَ |
| 23 | ثلاثة وعشرون | ثَلَاثَةٌ وَعِشْرُونَ |
| 24 | أربعة وعشرون | أَرْبَعَةٌ وَعِشْرُونَ |
| 25 | خمسة وعشرون | خَمْسَةٌ وَعِشْرُونَ |
| 26 | ستة وعشرون | سِتَّةٌ وَعِشْرُونَ |
| 27 | سبعة وعشرون | سَبْعَةٌ وَعِشْرُونَ |
| 28 | ثمانية وعشرون | ثَمَانِيَةٌ وَعِشْرُونَ |
| 29 | تسعة وعشرون | تِسْعَةٌ وَعِشْرُونَ |
10.4 Hundreds
| Number | Plain | With tashkeel |
|---|---|---|
| 100 | مائة | مِائَةٌ |
| 200 | مائتان | مِائَتَانِ |
| 300 | ثلاثمائة | ثَلَاثُمِائَةٍ |
| 400 | أربعمائة | أَرْبَعُمِائَةٍ |
| 500 | خمسمائة | خَمْسُمِائَةٍ |
| 600 | ستمائة | سِتُّمِائَةٍ |
| 700 | سبعمائة | سَبْعُمِائَةٍ |
| 800 | ثمانمائة | ثَمَانِمِائَةٍ |
| 900 | تسعمائة | تِسْعُمِائَةٍ |
10.5 Thousands and millions
| Number | Plain | With 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:
| Number | Feminine 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.

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:
arqamis the library: the part you load and call.arqamARis its Arabic engine: the part that writes the Arabic words.
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")arqam(1250)arqam(12345678901234567890n)arqam(1250.5, {currency: "QAR"})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")arqam("1250.50", "en-GB", {currency: "QAR"})Some topics have their own manuals:
- The library's manual: the library's names and how to load the languages you need; an amount in two languages at once (
toBilingual,toLanguages); ready wording for cheques, invoices, receipts and contracts (toClause). - The English manual: the English words.
Object.getPrototypeOf(arqam) === arqamARarqam.toBilingual("1250.50", "QAR").en12.1 Files and how to load them
| File | What it is | Use it for |
|---|---|---|
dist/arqamAR.mjs | ES 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, currencies | browsers (served over http), Node, Deno, bundlers |
dist/arqamAR.d.mts | TypeScript declarations: every option with its values, the currency attributes, the parts | editors and TypeScript projects (found automatically) |
dist/arqamExplain.d.mts | TypeScript declarations of explain(), explainDate(), explainTime(), explainFraction(), explainRange() and their result (each word, its part and rules) | TypeScript projects using arqam/explain |
dist/arqamUnits.mjs | the 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.js | import "arqam/units", only when style "unit" is used |
dist/SRI.txt | sha384 integrity hashes | pinning a CDN file |
src/arqamAR.js | the 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 page | editing 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 followarqam("2.5")arqam("-25%")arqam("11", {ordinal: "feminine"})arqam.toDate("18/11/2026", {calendar: "b", style: "compact"})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
- number: text such as
"1234.56"(Arabic-Western or Arabic-Eastern numbers, an optional.,-before,%after), a JS number or a BigInt; see 12.8. - 2nd parameter: a currency code or an options object. It applies to this call only; the standing options from
config()are untouched. - Returns the words; for a number that cannot be written, the
isNaNoption (default""), or withstrict: "on"it throws (12.9). A misspelt option or a bad value always throws aTypeError.
arqam("2500.35", {currency: "QAR"})arqam("2500.35", {currency: "USD"})arqam(["22", "0.55", "1.6"], {currency: "DZD"})arqam(["1", "2", "3"], {currency: "SYP"})A one-off option does not stick:
arqam.config({currency: "QAR"})arqam("30")arqam("20", {currency: "USD"})arqam("30")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) |
valid | true |
negative | true |
percent | false |
ordinal | "" |
prefix | فقط |
sign | سالب |
whole | ألف ومائتين وخمسين ريالًا قطريًا |
fraction | ، وخمسين درهمًا |
suffix | لا غير |
brackets | "(-1,250.50 QAR)" |
figure | "-1,250.50 QAR" |
| Field | Meaning |
|---|---|
text | the words, exactly as toWords() gives them |
valid | false when the number could not be written (text is then the isNaN option) |
negative percent ordinal | what kind of number it was |
prefix suffix | the words before and after, as written |
sign | «سالب» for a negative amount, else "" |
whole | the whole part with its currency name; all the words of a percentage or an ordinal |
fraction | the fraction with its joiner («، وخمسون درهما») |
brackets figure | the 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 | خمسون درهمًا قطريًا |
valid | true |
negative | false |
percent | false |
ordinal | "" |
prefix | "" |
sign | "" |
whole | "" |
fraction | خمسون درهمًا قطريًا |
suffix | "" |
brackets | "" |
figure | "" |
text | خمسة وعشرون بالمائة |
valid | true |
negative | false |
percent | true |
ordinal | "" |
prefix | "" |
sign | "" |
whole | خمسة وعشرون بالمائة |
fraction | "" |
suffix | "" |
brackets | "" |
figure | "" |
text | "" |
valid | false |
negative | false |
percent | false |
ordinal | "" |
prefix | "" |
sign | "" |
whole | "" |
fraction | "" |
suffix | "" |
brackets | "" |
figure | "" |
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"})arqam("3")arqam.config({tashkeel: "x"})arqam.config({compact: "yes"})arqam.config({compact: true})switches also take true and falsearqam("1234567")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")kw.config({wordOrder: "small"})kw.toWords("1250")arqam("1250")kw.options().currencyWhen 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 أغورةات).
| Attribute | Meaning | Example |
|---|---|---|
currDecimal | decimal places, 0–18 (default 2) | 3 |
majorSingle / majorPlural | the main unit, singular and plural | ريال / ريالات |
majorSingleC / majorPluralC | its adjective, singular and plural (optional) | قطري / قطرية |
minorSingle / minorPlural | the minor unit (optional) | درهم / دراهم |
minorSingleC / minorPluralC | its adjective (usually empty) | |
the eight names + T | the same names with full tashkeel, for tashkeel:"f" (a name without its T form is used as it is) | majorSingleT: "رِيَال" |
majorGender / minorGender | 0 masculine (default), 1 feminine: 3 to 10 take the opposite gender | 1 |
symbolLatin / symbolNative | English 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" |
openDecimals | decimals written as given (crypto); with currDecimal 0, any number of decimals | true |
qualifier / qualifierT | a fixed phrase after the number word, never declined, repeated after the minor unit | في الساعة |
idafa / idafaT | the second term of an iḍāfa, right after the noun: the noun loses its tanween and the dual its nūn | شاي |
country | the 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: "ك"
}).lengtharqam("2500.35", {currency: "ZZZ"})arqam("7.5", {currency: "ZZZ", brackets: "end", numSymbol: "symbol"})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"})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"})arqam.registerCurrency("NEW", {majorSingle: "x", majorPlural: "y", minorSingle: "z"})arqam.registerCurrency("NEW", {majorSingle: "x", majorPlural: "y", majorGender: 2})arqam.registerCurrency("NEW", {majorSingle: "x", majorPlural: "y", colour: "red"})arqam.registerCurrency("Z1", {})12.7 reset(), options(), defaults, version, currencies
On arqamAR, in the plain script and the module :
arqam.versionObject.keys(arqam.currencies).lengtharqam.config({tashkeel: "full", currency: "QAR"})arqam.options().tashkeelarqam.defaults.tashkeelarqam.reset()back to the defaults (registered currencies stay)arqam.options().tashkeel + " " + JSON.stringify(arqam.options().currency)JSON.stringify(arqam.optionNames.legal)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("بِسْمِ ٱللَّٰهِ ٱلرَّحْمَٰنِ ٱلرَّحِيمِ")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("١٢٣٤.٥٦")arqam(".5")arqam("007")arqam("-250")arqam("25%")arqam("-12.05%")arqam(12.5)arqam(1e21)arqam(-5)arqam(10n ** 30n)arqam(0.1 + 0.2)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"})arqam({}, {strict: "on"})arqam(Infinity, {strict: "on"})arqam("1" + "0".repeat(3003), {strict: "on"})arqam("0", {ordinal: "masculine", strict: "on"})arqam("3", {tashkel: "f"})arqam("3", {decSubInParts: "on"})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.
| Option | Values | Effect | Example |
|---|---|---|---|
currency | ""defaulta 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 | ""defaulta character or a locale | the thousands separator in the brackets only | "1234.56", {currency: "SAR", brackets: "end", sepThousands: "'"}ألف ومائتان وأربعة وثلاثون ريالًا سعوديًا، وست وخمسون هللةً (1'234.56 SAR) |
sepDecimal | ""defaulta 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 | ""defaulttext | words before the words; «فقط» makes the cheque form | "1234.56", {currency: "AED", prefix: "فقط"}فقط ألف ومائتان وأربعة وثلاثون درهمًا إماراتيًا، وستة وخمسون فلسًا |
suffix | ""defaulttext | 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 | ""defaulta 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 | ""defaulta 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 | ""defaultany value | returned for a number that cannot be written | "12,5", {isNaN: "—"}"—" |
zeroWords | ""defaulttext | 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)arqam("5", {tashkeel: "Full"}) === arqam("5", {tashkeel: "f"})arqam.config({tashkeel: "endings", ierab: "nasb"})arqam.options().tashkeel + arqam.options().ierabarqam.reset()arqam("5", {legal: "off"})tashkeel
| Name | Short code | Meaning | Example "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
| Name | Short code | Meaning | Example "2003", {currency: "QAR", tashkeel: "full"} |
|---|---|---|---|
"raf" default | "r" | nominative (مرفوع), the default: the amount is the subject: المبلغُ ألفا ريالٍ | أَلْفَانِ وَثَلَاثَةُ رِيَالَاتٍ قَطَرِيَّةٍ |
"nasb" | "n" | accusative (منصوب): دفعتُ ألفي ريالٍ | أَلْفَيْنِ وَثَلَاثَةَ رِيَالَاتٍ قَطَرِيَّةٍ |
"jarr" | "j" | genitive (مجرور): بمبلغ ألفي ريالٍ | أَلْفَيْنِ وَثَلَاثَةِ رِيَالَاتٍ قَطَرِيَّةٍ |
legal
| Name | Short code | Meaning | Example "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
| Name | Short code | Meaning | Example "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
| Name | Short code | Meaning | Example "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
| Name | Short code | Meaning | Example "21" |
|---|---|---|---|
| (not given) default | "" | a cardinal number | واحد وعشرون |
"masculine" | "m" | the masculine ordinal: الحادي والعشرون | الحادي والعشرون |
"feminine" | "f" | the feminine ordinal: الحادية والعشرون | الحادية والعشرون |
12.10.2 currency
currencynumbers, 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 to | toWords, 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
| Value | Meaning |
|---|---|
"" default | 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 |
| 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"})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"})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
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 to | toWords, 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
| Value | Meaning |
|---|---|
"" 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"})Related questions
See also
12.10.4 tashkeel
tashkeeltanween 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 to | toWords, 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
| Value | Other names | Meaning |
|---|---|---|
"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
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"})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
12.10.5 ierab
ierabnominative · 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 to | toWords, 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
| Value | Other names | Meaning |
|---|---|---|
"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"})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
12.10.6 legal
legallegal 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 to | toWords, 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
| Value | Other names | Meaning |
|---|---|---|
"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"})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
12.10.7 scale
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 to | toWords, 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
| Value | Meaning |
|---|---|
"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
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"})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
12.10.8 brackets
bracketsthe 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 to | toWords, 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"})arqam("1234.56", {currency: "EGP", brackets: "start"})arqam("1234.56", {currency: "EGP", brackets: "decimals"})Examples
After the words
arqam("1234.56", {currency: "SAR", brackets: "end"})Before the words
arqam("1234.56", {currency: "SAR", brackets: "start"})The fraction in brackets
arqam("12.75", {brackets: "decimals"})Arabic-Eastern numbers
arqam("1234.56", {currency: "EGP", brackets: "end", arabicNumbers: "eastern"})Another bracket
arqam("1234.56", {currency: "SAR", brackets: "end", bracketsType: "[]"})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"})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
bracketsTypethe bracket characters
Format
arqam(number, {bracketsType: value})
new arqam.NumberFormat("ar", {bracketsType: value}).format(number)
arqam.config({bracketsType: value})| Values | "" | "[]" | "{}" | "«»" |
|---|---|
| Default | "" |
| Applies to | toWords, 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: ""})arqam("1234.56", {currency: "MAD", brackets: "end", bracketsType: "[]"})arqam("1234.56", {currency: "MAD", brackets: "end", bracketsType: "{}"})arqam("1234.56", {currency: "MAD", brackets: "end", bracketsType: "«»"})Examples
Round (the default)
arqam("1234.56", {currency: "MAD", brackets: "end"})Square brackets
arqam("1234.56", {currency: "MAD", brackets: "end", bracketsType: "[]"})Braces
arqam("1234.56", {currency: "MAD", brackets: "end", bracketsType: "{}"})Guillemets
arqam("1234.56", {currency: "MAD", brackets: "end", bracketsType: "«»"})Before the words
arqam("1234.56", {currency: "MAD", brackets: "start", bracketsType: "[]"})The fraction in brackets
arqam("12.75", {brackets: "decimals", bracketsType: "[]"})With Arabic-Eastern numbers
arqam("1234.56", {currency: "EGP", brackets: "end", bracketsType: "«»", arabicNumbers: "eastern"})Works with
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
See also
12.10.10 numSymbol
numSymbolin 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 to | toWords, 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
| Value | Other names | Meaning |
|---|---|---|
"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"})arqam("1234.56", {currency: "QAR", brackets: "end", numSymbol: "english"})arqam("1234.56", {currency: "QAR", brackets: "end", numSymbol: "native"})arqam("1234.56", {currency: "QAR", brackets: "end", numSymbol: "sign"})arqam("1234.56", {currency: "QAR", brackets: "end", numSymbol: "name"})arqam("1234.56", {currency: "QAR", brackets: "end", numSymbol: "none"})Examples
The ISO code (the default)
arqam("1234.56", {currency: "QAR", brackets: "end"})The English symbol
arqam("1234.56", {currency: "USD", brackets: "end", numSymbol: "english"})The native symbol
arqam("1234.56", {currency: "QAR", brackets: "end", numSymbol: "native"})The Unicode sign
arqam("1234.56", {currency: "SAR", brackets: "end", numSymbol: "sign"})The name
arqam("1234.56", {currency: "QAR", brackets: "end", numSymbol: "name"})A symbol of your own
arqam("1234.56", {currency: "QAR", brackets: "end", numSymbol: "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
12.10.11 currDecForce
currDecForcethe 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 to | toWords, 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
| Value | Meaning |
|---|---|
"on" default | the 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"})arqam("1234", {currency: "QAR", brackets: "end", currDecForce: "off"})Examples
On (the default)
arqam("1234", {currency: "KWD", brackets: "end"})Off
arqam("1234", {currency: "KWD", brackets: "end", currDecForce: "off"})Works with
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"})Related questions
See also
12.10.12 arabicNumbers
arabicNumbersArabic-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 to | toWords, 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"})arqam("1234.56", {currency: "QAR", brackets: "end", arabicNumbers: "on"})arqam("1234.56", {currency: "QAR", brackets: "end", arabicNumbers: "western"})arqam("1234.56", {currency: "QAR", brackets: "end", arabicNumbers: "eastern"})Examples
Arabic-Western (the default)
arqam("1234.56", {currency: "SAR", brackets: "end"})Arabic-Eastern
arqam("1234.56", {currency: "SAR", brackets: "end", arabicNumbers: "eastern"})By the region
arqam("1234.56", {locale: "ar-EG", style: "currency", brackets: "end"})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"})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
sepThousandsthe 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 to | toWords, 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
| Value | Meaning |
|---|---|
"" default | the thousands separator in the brackets only |
| a character or a locale | |
Examples
A dot
arqam("1234567.5", {currency: "EUR", brackets: "end", sepThousands: ".", sepDecimal: ","})An apostrophe
arqam("1234567.5", {currency: "CHF", brackets: "end", sepThousands: "'"})A space
arqam("1234567.5", {currency: "SAR", brackets: "end", sepThousands: " "})A locale for both
arqam("1234567.5", {currency: "EUR", brackets: "end", sepThousands: "fr"})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
12.10.14 sepDecimal
sepDecimalthe 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 to | toWords, 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
| Value | Meaning |
|---|---|
"" default | the 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: ","})The Arabic separator
arqam("1234.5", {currency: "SAR", brackets: "end", sepDecimal: "٫", sepThousands: "٬"})A locale for both
arqam("1234.5", {currency: "EUR", brackets: "end", sepDecimal: "de"})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
12.10.15 prefix
prefixwords 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 to | toWords, 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
| Value | Meaning |
|---|---|
"" default | words 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
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
12.10.16 suffix
suffixwords 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 to | toWords, 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
| Value | Meaning |
|---|---|
"" default | words 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
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
12.10.17 compact
compactgroups 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 to | toWords, 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
| Value | Meaning |
|---|---|
"off" default | not 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"})Examples
A large amount
arqam("1234567", {currency: "QAR", compact: "on"})Millions
arqam("45000000", {compact: "on"})Works with
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"})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
12.10.18 comma
commathe 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 to | toWords, 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
| Value | Meaning |
|---|---|
"off" default | not 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
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"})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
12.10.19 miah
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 to | toWords, 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
| Value | Meaning |
|---|---|
"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
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"})Related questions
See also
12.10.20 miahSplit
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 to | toWords, 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
| Value | Meaning |
|---|---|
"off" default | not 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
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"})Related questions
See also
12.10.21 tanweenAlif
tanweenAliftanween 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 to | toWords, 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
| Value | Meaning |
|---|---|
"off" default | not 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
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"})Related questions
See also
12.10.22 addZero
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 to | toWords, 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
| Value | Meaning |
|---|---|
"off" default | not 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
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"})Related questions
See also
12.10.23 decFormat
decFormatthe 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 to | toWords, 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
| Value | Other 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"})arqam("12.75", {decFormat: "digits"})arqam("12.75", {decFormat: "words-words"})arqam("12.75", {decFormat: "words-figures"})arqam("12.75", {decFormat: "figures-words"})arqam("12.75", {decFormat: "figures-figures"})arqam("12.75", {decFormat: "decimal"})arqam("12.75", {decFormat: "slash"})Examples
Auto (the default)
arqam("12.13", {currency: "QAR"})Words
arqam("12.13", {decFormat: "words"})Figures
arqam("12.13", {currency: "QAR", decFormat: "figures"})Digits
arqam("12.13", {decFormat: "digits"})Slash
arqam("12.13", {currency: "QAR", decFormat: "slash"})Works with
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"})Related questions
See also
12.10.24 decJuz
decJuzthe 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 to | toWords, 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
| Value | Meaning |
|---|---|
"on" default | the 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
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"})Related questions
See also
12.10.25 decAL
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 to | toWords, 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
| Value | Meaning |
|---|---|
"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
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"})Related questions
See also
12.10.26 decFaslah
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 to | toWords, 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
| Value | Meaning |
|---|---|
"off" default | not 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
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"})Related questions
See also
12.10.27 decIgnore
decIgnorethe 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 to | toWords, 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
| Value | Meaning |
|---|---|
"off" default | not 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
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"})Related questions
See also
12.10.28 decRound
decRounddecimal 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 to | toWords, 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
| Value | Meaning |
|---|---|
"" default | decimal 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"})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
12.10.29 rounding
roundingan 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 to | toWords, 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
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"})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
12.10.30 ignoreCountry
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 to | toWords, 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
| Value | Meaning |
|---|---|
"off" default | not 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
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"})Related questions
See also
12.10.31 percent
percenta 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 to | toWords, 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
| Value | Meaning |
|---|---|
"off" default | not 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
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"})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
12.10.32 ordinal
ordinalthe 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 to | toWords, 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
| Value | Other 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
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"})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
12.10.33 wordOrder
wordOrderthe 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 to | toWords, 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
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"})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
12.10.34 approx
approxan 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 to | toWords, 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"})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
12.10.35 approxWord
approxWordthe 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 to | toWords, 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
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"})Related questions
- Q552 Can I use «نحو», «زهاء» or «حوالَيْ» instead of «قرابة»?
See also
12.10.36 approxRound
approxRoundwith 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 to | toWords, 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
| Value | Meaning |
|---|---|
"" default | with 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
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"})Related questions
- Q557 Can Arqam round the number first?
See also
12.10.37 errorLanguage
errorLanguagethe 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 to | toWords, 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"})12.10.38 locale
localethe 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 to | every 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"})arqam("1500.5", {locale: "ar-QA", brackets: "end"})arqam("1500.5", {locale: "ar-KM", brackets: "end"})Examples
Qatar
arqam("1500", {locale: "ar-QA", style: "currency"})Egypt
arqam("1500", {locale: "ar-EG", style: "currency", brackets: "end"})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"})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
12.10.39 timeZone
timeZonethe 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 to | toDate, 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
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"})Related questions
See also
12.10.40 zoneName
zoneNamehow 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 to | toDate, 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"})arqam.toTime("2026-11-24T07:30:00Z", {timeZone: "Asia/Qatar", zoneName: "both"})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"})Both
arqam.toTime("2026-11-24T07:30:00Z", {timeZone: "Asia/Qatar", zoneName: "both"})Works with
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"})Related questions
- Q563 Can I name the country instead of the city?
See also
12.10.41 strict
strictthrow 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 to | toWords, 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
| Value | Meaning |
|---|---|
"off" default | not applied |
"on" | throw instead of returning isNaN (12.9) |
Every value on one example
arqam("12,5", {strict: "off"})arqam("12,5", {strict: "on"})Examples
Off (the default)
arqam("12,5")On
arqam("12,5", {strict: "on"})Works with
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"})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
12.10.42 isNaN
isNaNreturned 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 to | toWords, 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
| Value | Meaning |
|---|---|
"" default | returned 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}))A comma instead of a point
arqam("1,5", {isNaN: "—"})Instead, an error
arqam("abc", {strict: "on"})Works with
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
12.10.43 zeroWords
zeroWordsthe 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 to | toWords, 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
| Value | Meaning |
|---|---|
"" default | the 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
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
12.10.44 split
splitcolour 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 to | toWords, 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
| Value | Meaning |
|---|---|
"off" default | not 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"])Works with
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"})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
12.10.45 currDecimal, majorSingle…
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 to | toWords, 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
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
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"})arqam("2", {currency: "JPY"})arqam("3", {currency: "SYP"})arqam("100", {currency: "EUR", tashkeel: "full"})arqam("0.00512", {currency: "BTC"})arqam("0.5", {currency: "MAD", decFormat: "words-words"})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"})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 code | English | Native | Symbol | Note |
|---|---|---|---|---|
| QAR | QR | ر.ق. | — | |
| SAR | SR | ر.س. | | U+20C1, Unicode 17.0 (September 2025) |
| AED | Dh | د.إ. | | U+20C3, Unicode 18.0 (September 2026) |
| OMR | OR | ر.ع. | | U+20C4, Unicode 18.0 (September 2026) |
| KWD | KD | د.ك. | — | |
| IQD | — | د.ع. | — | |
| USD | — | — | $ | |
| EUR | — | — | € | |
| INR | Rs. | — | ₹ | |
| UAH | — | грн | ₴ |
When the chosen sign is empty. A currency does not have every sign, so the brackets are never left empty:
| numSymbol | If it is empty, use | If that is also empty |
|---|---|---|
"code" (default) | — | — |
"english" | Native | the ISO code |
"native" | English | the ISO code |
"sign" | Native | the ISO code |
arqam("1234.5", {currency: "SAR", brackets: "end", numSymbol: "sign"})arqam("250", {currency: "USD", brackets: "end", numSymbol: "sign"})arqam("1500", {currency: "QAR", brackets: "end", numSymbol: "sign"})arqam("1500", {currency: "IQD", brackets: "end", numSymbol: "english"})arqam("250", {currency: "USD", brackets: "end", numSymbol: "native"})arqam.symbols.EURObject.keys(arqam.symbols).lengthThe 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"})arqam.registerCurrency("QAR", {symbol: ""})&&""arqam("10", {currency: "QAR", brackets: "end", numSymbol: "sign"})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))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"})arqam(-7, {currency: "QAR", tashkeel: "full"})arqam("-0.001", {currency: "QAR"})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"})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.
| Option | Grammarians | Rule | 3,000 | 200,000 | 200,001 | In Arqam |
|---|---|---|---|---|---|---|
| A | Basran (the main grammar books) | «ال» on the second word only; the number becomes definite through the iḍāfa | ثلاثة الآلاف | مائتا الألف | الحادي بعد مائتي الألف | Used: Arqam writes A only |
| B | Kufan | «ال» 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.75 | currency: 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"})arqam("2.675", {currency: "QAR", rounding: "on"})arqam("9.999", {currency: "QAR", rounding: "on"})arqam("12.05", {decFormat: "words"})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"})arqam("1250.125", {currency: "KWD", wordOrder: "small"})arqam("1003", {currency: "SYP", wordOrder: "small"})arqam("1250", {currency: "AED", wordOrder: "small", ierab: "nasb", prefix: "دفعتُ"})arqam("1234567", {wordOrder: "small", compact: "on"})arqam.toDate("18/11/2026", {wordOrder: "small", year: "sana"})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, "")function arqamColourHTML(marked) { // |p punctuation · |c currency · |f| fraction · | group
const esc = t => t.replace(/&/g, "&").replace(/</g, "<");
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"
})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
- date: text, or a JS
Date(its own calendar day, as the computer shows it). The accepted text forms are in the table below. - options: the date options below, plus six number options it shares:
tashkeel,arabicNumbers,miah,strict,isNaN,wordOrder. Those six also come fromconfig(); the date options are given with each call. Unknown names and bad values throw aTypeError. - Returns the words; a date that cannot be read gives the
isNaNoption, or withstrict: "on"aTypeError(wrong form) orRangeError(no such day) that says why. - The Hijri date is the Umm al-Qura calendar built into JavaScript (
Intl): no download, no network. It follows the official tables for 1300–1600 AH (1882–2174) and the arithmetic calendar outside them, and can differ by a day from a moon sighting in some countries.
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"})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"
})arqam.toDate("31/1/1920", {style: "ordinal", months: "both", year: "aam", era: "long"})arqam.toDate("8 جمادى الآخرة 1448", {input: "h", calendar: "b", style: "compact"})arqam.toDate(new Date(2026, 10, 18), {style: "compact", months: "levant"})arqam.toDate(["1/1/2026", "x", "1/7/2026"], {style: "compact", calendar: "h"})| Option | Values | What it does | Example |
|---|---|---|---|
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"):
| Input | Form | Result |
|---|---|---|
| 18/11/2026 | day/month/year with / - . or a space | 18 نوفمبر 2026م |
| 2026-11-18 | ISO: year-month-day | 18 نوفمبر 2026م |
| 2026-11-18T23:30:00Z | ISO with a time: the date part, never moved by a time zone | 18 نوفمبر 2026م |
| ١٨؍١١؍٢٠٢٦ | Arabic-Eastern or Persian numbers and the Arabic date separator ؍ | 18 نوفمبر 2026م |
| 18 تشرين الثاني 2026 | a month by name: Gulf, Levant, Maghreb, Moroccan | 18 نوفمبر 2026م |
| 18 نوفمبر/تشرين الثاني 2026 | the Levant date | 18 نوفمبر 2026م |
| November 18, 2026 | English month names, full or short | 18 نوفمبر 2026م |
| 18/11/2026م | «م» (or ميلادي، ميلادية، AD، CE) after the year: Gregorian, as without it | 18 نوفمبر 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هـ")arqam.toDate("18 ذو القعدة 1447")arqam.toDate("18/11/1447", {input: "h"})arqam.toDate("18/11/1447هـ", {calendar: "g"})arqam.toDate("18/11/1447هـ", {calendar: "b", style: "compact"})arqam.toDate("18/11/2026م", {calendar: "h"})arqam.toDate("18/11/1447")arqam.toDate("18/11/1447هـ", {input: "g", strict: "on"})| After the year | Read as | Example | Result |
|---|---|---|---|
| هـ · ه · هجري · هجرية · AH | Hijri | 18/11/1447 هجري | 18 ذي القعدة 1447هـ |
| م · ميلادي · ميلادية · AD · CE | Gregorian | 18/11/2026 ميلادي | 18 نوفمبر 2026م |
| a Hijri month name | Hijri | 18 ذي القعدة 1447 | 18 ذي القعدة 1447هـ |
| nothing | Gregorian (or input) | 18/11/2026 | 18 نوفمبر 2026م |
Refused rather than guessed (here with strict: "on"):
arqam.toDate("18/11/26", {strict: "on"})arqam.toDate("12/25/2026", {strict: "on"})arqam.toDate("31/2/2026", {strict: "on"})arqam.toDate("20261118", {strict: "on"})arqam.toDate(1763424000000, {strict: "on"})arqam.toDate("18/11-2026", {strict: "on"})arqam.toDate("الأربعاء 18/11/2026", {strict: "on"})arqam.toDate("18/11/1447هـ", {input: "g", strict: "on"})arqam.toDate("18 نوفمبر 2026هـ", {strict: "on"})arqam.toDate("30/6/1448", {input: "h", strict: "on"})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
- time: text such as
"15:45","3:15 pm","3:15 م","07:05:30"(Arabic-Eastern numbers too), or a JSDate(its local time). A duration may have more than 23 hours. - fraction:
"3/4","3 1/2","3½","¾","11/4", a whole number, or a decimal ("2.5"is read as 5/2 and simplified: اثنان ونصف). - options: their own options below, plus the number options they share:
tashkeel,tanweenAlif,miah,strict,isNaN(and for fractionscode,ignoreCountry,comma). The shared ones also come fromconfig(). Unknown names and bad values throw aTypeError; input that cannot be read givesisNaN, or withstrict: "on"an error that says why. - The counted words (دقيقة، ثانية، ساعة، جزء and the fraction nouns نصف … عشر) are counted by the engine itself, so gender, case and tashkeel follow the same rules as
toWords(). The hour is a feminine ordinal: الساعة الثالثة، الخامسة عشرة؛ one o'clock is الساعة الواحدة.
arqam.toTime("13:35")arqam.toTime("13:35", {timeParts: "on"})arqam.toTime("13:35", {timeStyle: "exact"})arqam.toTime("13:35", {timeStyle: "h24"})arqam.toTime("0:25")arqam.toTime("0:25", {timeParts: "on", tashkeel: "full"})arqam.toTime("15:00", {timeStyle: "exact"})arqam.toTime("15:25", {timeParts: "on", tashkeel: "full"})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"})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 | مَسَاءً | مَسَاءً | — |
| Option | Values | What it does | Example |
|---|---|---|---|
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")arqam.toFraction("3/4", {fractionForm: "math"})arqam.toFraction("11/4")arqam.toFraction("2.5")arqam.toFraction("2 1/2", {currency: "QAR"})arqam.toFraction("1/2", {currency: "QAR", fractionUnit: "named", tashkeel: "full"})arqam.toFraction("1/3", {currency: "QAR"})arqam.toFraction("1/0", {strict: "on"})| Option | Values | What it does | Example |
|---|---|---|---|
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".
| Value | emphasisOneTwo: "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"…}) | ريال قطري واحد وثلث | ريال قطري وثلث |
| Call | default | the 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("لدي ألفان وخمسمائة ريال وثلاثة كتب")wordsToNumbers("خمستاشر ومية وتنين وجوج وربعين")wordsToNumbers("سبعين وثمان مائة واثنين وعشرين ألفا وثمانية ملايين")wordsToNumbers("مليونين ونص، وثلاثة إلا ربع")wordsToNumbers("سالب اثني عشر فاصلة خمسة بالمائة")wordsToNumbers("2 مليون و1.5 مليار")wordsToNumbers("ألف، ومائتان وخمسون ريالًا قطريًا، وخمسون درهمًا")wordsToNumbers("ألف، ومائتان وخمسون ريالًا قطريًا، وخمسون درهمًا", {currency: "code"})wordsToNumbers("البند الخامس والعشرون بعد المائة", {ordinals: "on"})wordsToNumbers("مائتان وألف")wordsToNumbers("مائتان وألف", {order: "small"})JSON.stringify(wordsToNumbers.find("لدي ألفان وخمسمائة ريال"))wordsToNumbers.value("تسعمائة وتسعة وتسعون ألفًا")JSON.stringify(wordsToNumbers.verify("فقط ألف، ومائتان وخمسون ريالًا قطريًا، وخمسون درهمًا لا غير", "1250.50", {currency: "QAR"}))JSON.stringify(wordsToNumbers.verify("ألف ومائتان وخمسون ريالًا", "1250.05"))wordsToNumbers.verify("ألف ريال قطري، وخمسون درهما", "1250.75", {currency: "QAR"}).issuewordsToNumbers.verify("ألف ومائتان وخمسون ريالا قطريا، وخمسون درهما", "1250.75", {currency: "QAR"}).issuewordsToNumbers.verify("ألف ريال قطري، وخمسون درهما", "1250.75", {currency: "QAR"}).differencewordsToNumbers.verify("ألف ريال قطري، وخمسون درهما", "1250.75", {currency: "QAR"}).expectedWordsHundreds 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("ثلاثمائة وألفان")wordsToNumbers.verify(arqam("302000"), "302000").okwordsToNumbers.value("ثلاثمائة وألفان", {order: "small"})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.
| Option | Values | Meaning |
|---|---|---|
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("حُرِّر هذا العقد في الثامن عشر من شهر نوفمبر لعام ألفين وستة وعشرين")wordsToNumbers("الثامن عشر من شهر ذي القعدة لعام ألف وأربعمائة وسبعة وأربعين للهجرة، الموافق الخامس من شهر مايو لعام ألفين وستة وعشرين للميلاد")wordsToNumbers("يبدأ الاجتماع الساعة الثالثة وخمس عشرة دقيقة عصرًا ويستمر ساعتين ونصفًا")wordsToNumbers("الساعة الثالثة وخمس عشرة دقيقة")JSON.stringify(wordsToNumbers.find("غرة شهر رمضان لعام ألف وأربعمائة وسبعة وأربعين"))wordsToNumbers("الثامن عشر من شهر نوفمبر لعام ألفين وستة وعشرين", {dates: "off"})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"})JSON.stringify(arqam.findNumbers("بعت ثلاثة وأخذت عشرين").map(m => m.value))arqam.verify("فقط ألف ومائتان وخمسون ريالًا قطريًا لا غير", "1250", {currency: "QAR"}).ok12.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].whyarqam.explain("3000000", {tashkeel: "full"}).words[1].shortObject.values(arqam.explain("1253.75", {currency: "MAD"}).rules).map(r => r.title).join("، ")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)new arqam.NumberFormat("ar").format(2500)arqam.NumberFormat({tashkeel: "full"}).format(2500)new arqam.NumberFormat("ar-QA", {style: "currency"}).format(1234.5)JSON.stringify([1, 2, 3].map(arqam.NumberFormat({style: "ordinal"}).format))JSON.stringify(arqam.NumberFormat().format(["1", "2"]))The eight styles
| style | What it writes | The same as | In 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 currency | toWords(n, code) | yes |
"unit" | units of measure (with the units add-on) | the page's units | yes |
"ordinal" | ordinals, masculine by default | toWords(n, {ordinal}) | no |
"fraction" | typed fractions | toFraction(f) | no |
"time" | the time of day or a duration | toTime(t) | no (DateTimeFormat) |
"date" | dates, Gregorian or Hijri | toDate(d) | no (DateTimeFormat) |
arqam.NumberFormat({style: "percent"}).format(0.125)arqam.NumberFormat({style: "percent"}).format(0.07)arqam.NumberFormat({currency: "KWD"}).format("12.345")arqam.NumberFormat("ar-SA", {style: "currency"}).format(2500)arqam.NumberFormat({style: "unit", unit: "kilometer"}).format(12.5)arqam.NumberFormat({style: "unit", unit: "kilometer-per-hour"}).format(120)arqam.NumberFormat({style: "unit", unit: "ملعقة شاي"}).format(3)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")arqam.NumberFormat({style: "date", calendar: "both", dateForm: "compact"}).format("2026-11-21")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.
| Field | Position in js/data.js | Meaning | Example (unit) |
|---|---|---|---|
decimals | 0 | Decimal 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 | |||
majorSingle | 1 | The unit, singular | "كيلومتر" (A05) |
majorPlural | 3 | The unit, plural | "كيلومترات" (A05) |
minorSingle | 5 | The minor unit, singular | "متر" (A05) |
minorPlural | 7 | The minor unit, plural | "أمتار" (A05) |
| The second word of each name (an adjective, a qualifier or an iḍāfa word; see secondAs) | |||
majorSingleC | 2 | Second word of majorSingle | "هجرية" (F10) سنة هجرية |
majorPluralC | 4 | Second word of majorPlural | "هجرية" (F10) سنوات هجرية |
minorSingleC | 6 | Second word of minorSingle | "في الساعة" (E04) متر في الساعة |
minorPluralC | 8 | Second word of minorPlural | "في الساعة" (E04) أمتار في الساعة |
| The same names with vowel marks (tashkīl), used when vowel marks are switched on | |||
majorSingleT | 9 | majorSingle with vowel marks | "كِيلُومِتْر" (A05) |
majorPluralT | 11 | majorPlural with vowel marks | "كِيلُومِتْرَاتٍ" (A05) |
minorSingleT | 13 | minorSingle with vowel marks | "مِتْر" (A05) |
minorPluralT | 15 | minorPlural with vowel marks | "أمْتَارٍ" (A05) |
majorSingleCT | 10 | majorSingleC with vowel marks | "هِجْرِيَّة" (F10) |
majorPluralCT | 12 | majorPluralC with vowel marks | "هِجْرِيَّةٍ" (F10) |
minorSingleCT | 14 | minorSingleC with vowel marks | "فِي السَّاعَة" (E04) |
minorPluralCT | 16 | minorPluralC with vowel marks | "فِي السَّاعَة" (E04) |
| Gender (decides ثلاثة / ثلاث) | |||
majorGender | 17 | 1 = the unit is feminine. Left out: masculine. | 1 (A09) ياردة |
minorGender | 18 | 1 = the minor unit is feminine. Left out: masculine. | 1 (F14) قرن: سنة |
| Symbols (shown in brackets after the words) | |||
symbolNative | 19 | The Arabic symbol | "كم" (A05) |
symbolLatin | 20 | The Latin-script symbol. Left out: symbolNative is used. | "كم" (A05) |
| How the second word is read | |||
secondAs | 21 | "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}
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 name | Arqam name | Values |
|---|---|---|
currency | code | an ISO code; default: the currency of the locale's country (ar-QA → QAR) |
currencyDisplay | numSymbol | "code" "symbol" "narrowSymbol" "name" "sign" "native" "english" (symbol and narrowSymbol give the Symbol, $, as Intl does) |
numberingSystem, or -u-nu-arab | arabicNumbers | "arab" "latn" |
calendar, or -u-ca-islamic | calendar | "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) |
roundingMode | rounding | "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) |
| — | dateForm | toDate's style: "words" "ordinal" "compact" |
arqam.NumberFormat({currency: "USD", currency: "SAR"}).format(7)arqam.NumberFormat("ar-QA-u-nu-arab", {style: "currency", brackets: "end"}).format(1234.5)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().
-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"})arqam.reset()JSON.stringify(arqam.NumberFormat.supportedLocalesOf(["ar-QA", "en-GB", "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())JSON.stringify(arqam.NumberFormat.styles)arqam.NumberFormat("en")arqam.NumberFormat({style: "currency"})arqam.NumberFormat({useGrouping: false})arqam.NumberFormat({style: "unit", unit: "parsecs"})arqam.NumberFormat({timeStyle: "exact"})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
new Intl.NumberFormat("ar-EG", {style: "currency", currency: "QAR"}).formatToParts(1250.5)arqam.NumberFormat({style: "currency", currency: "QAR"}).formatToParts(1250.5)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
| Type | What it is | Example |
|---|---|---|
| integer | the number words of the whole part; one part for each group, scale words included (خمسمائة ألف) | مليونان |
| fraction | the number words of the fraction or the minor amount | خمسون |
| currency | the name of the currency | ريالًا قطريًا |
| minorCurrency | the name of the minor unit (Arqam's own: Intl has one currency per amount) | درهمًا |
| unit | the name of the unit (style "unit") | كيلوغرامان |
| minorUnit | the name of the smaller unit | غرام |
| denominator | what the fraction counts (Arqam's own) | جزءًا من المائة |
| decimal | the decimal sign in words | |
| percentSign | the percent words | بالمائة |
| minusSign | the sign word | سالب |
| ordinal | an ordinal, as one part (Arqam's own) | الحادي والعشرون |
| prefix | the prefix option (Arqam's own) | فقط |
| suffix | the suffix option (Arqam's own) | لا غير |
| figure | the figure in brackets, with its own list of parts in .parts (Arqam's own) | (1,250.50 QAR) |
| day | the day of a date | الخامس عشر |
| month | the month | نوفمبر |
| year | the year | ألفين وستة وعشرين |
| era | the era | للميلاد |
| hour | the hour | الثالثة |
| minute | the minutes, with their noun | خمس عشرة دقيقةً |
| second | the seconds, with their noun | ثلاثون ثانيةً |
| dayPeriod | the part of the day | عصرًا |
| literal | the 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.
NumberFormat({style: "currency", currency: "QAR"}).formatToParts(1250.5)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: "درهمًا"} ]
NumberFormat({style: "currency", currency: "QAR", tashkeel: "full"}).formatToParts(1250.5)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: "دِرْهَمًا"} ]
NumberFormat({style: "currency", currency: "QAR",
prefix: "فقط", suffix: "لا غير", brackets: "end"}).formatToParts(1250.5)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]} ]
NumberFormat({style: "currency", currency: "QAR", brackets: "end"}).formatToParts(-7.25)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]} ]
NumberFormat({style: "currency", currency: "USD"}).formatToParts(2500000)The list the program gets
[ {type: "integer", value: "مليونان"}, {type: "literal", value: " و"}, {type: "integer", value: "خمسمائة ألف"}, {type: "literal", value: " "}, {type: "currency", value: "دولار أمريكي"} ]
NumberFormat({style: "percent"}).formatToParts(0.125)The list the program gets
[ {type: "integer", value: "ثلاثة عشر"}, {type: "literal", value: " "}, {type: "percentSign", value: "بالمائة"} ]
NumberFormat().formatToParts(1250.75)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: "جزءًا من المائة"} ]
NumberFormat({style: "ordinal"}).formatToParts(21)The list the program gets
[ {type: "ordinal", value: "الحادي والعشرون"} ]
NumberFormat({style: "unit", unit: "kilogram"}).formatToParts(2.5)The list the program gets
[ {type: "unit", value: "كيلوغرامان"}, {type: "literal", value: "، و"}, {type: "fraction", value: "خمسمائة"}, {type: "literal", value: " "}, {type: "minorUnit", value: "غرام"} ]
NumberFormat({style: "date"}).formatToParts("2026-11-15")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: "للميلاد"} ]
NumberFormat({style: "date", calendar: "both", dateForm: "compact"}).formatToParts("2026-11-21")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: "هـ"} ]
NumberFormat({style: "time"}).formatToParts("15:15")The list the program gets
[ {type: "literal", value: "الساعة "}, {type: "hour", value: "الثالثة"}, {type: "literal", value: " و"}, {type: "minute", value: "خمس عشرة دقيقةً"}, {type: "literal", value: " "}, {type: "dayPeriod", value: "عصرًا"} ]
NumberFormat({style: "time", timeParts: true}).formatToParts("9:45")The list the program gets
[ {type: "literal", value: "الساعة "}, {type: "hour", value: "العاشرة"}, {type: "literal", value: " إلا "}, {type: "minute", value: "الربع"}, {type: "literal", value: " "}, {type: "dayPeriod", value: "صباحًا"} ]
NumberFormat({style: "fraction"}).formatToParts("2 3/4")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.
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);
const words = parts.filter(p => p.type !== "figure").map(p => p.value).join("").trim();
const figure = parts.find(p => p.type === "figure").value;.t-integer, .t-fraction { color: #1f5fbf; font-weight: 700 }
.t-currency, .t-minorCurrency { color: #0f7b4c }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>
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(" ")arqam.NumberFormat({style: "currency", currency: "QAR"}).formatToParts(1250.5).map(p => p.value).join("")arqam.NumberFormat({style: "percent"}).formatToParts(0.125).find(p => p.type === "percentSign").valueJSON.stringify(arqam.NumberFormat({style: "currency", currency: "QAR", brackets: "end"}).formatToParts(7).pop().parts.map(p => p.type))JSON.stringify(arqam.NumberFormat({style: "ordinal"}).formatToParts([1, 2]))JSON.stringify(arqam.NumberFormat().formatToParts("x"))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
new Intl.NumberFormat("ar-EG", {style: "currency", currency: "QAR"}).formatRange(1000, 2000)arqam.NumberFormat({style: "currency", currency: "QAR"}).formatRange(1000, 2000)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.
| Values | Two format() calls joined by hand | formatRange() |
|---|---|---|
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); // من ألف ريال قطري إلى ألفي ريال قطري
NumberFormat({style: "currency", currency: "QAR"}).formatRange(1000, 2000)NumberFormat().formatRange(5, 10)NumberFormat({style: "percent"}).formatRange(0.05, 0.1)NumberFormat({style: "unit", unit: "kilometer"}).formatRange(3, 5)NumberFormat({style: "date"}).formatRange("2026-11-01", "2026-11-15")NumberFormat({style: "time"}).formatRange("9:00", "17:30")The rules, with examples
formatRange(5, 5) → format(5)formatRange(2000, 1000)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.
[ {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"} ]
Recipes
const html = parts.map(p => p.source === "shared" ? p.value
: `<span class="${p.source}">${p.value}</span>`).join("");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();const f = arqam.NumberFormat({style: "currency", currency: "QAR", tashkeel: "full"});
"تتراوح قيمة العقد " + f.formatRange(250000, 1000000)const f = arqam.NumberFormat({style: "currency", currency: "QAR"});
bands.map(([a, b]) => f.formatRange(a, b));More styles and options
NumberFormat({style: "ordinal", tashkeel: "full"}).formatRange(1, 21)NumberFormat({style: "time", timeStyle: "duration"}).formatRange("1:30", "2:45")NumberFormat({style: "time", timeParts: true}).formatRange("9:15", "17:30")NumberFormat({style: "fraction"}).formatRange("1/2", "2 3/4")NumberFormat({style: "date", dateForm: "compact"}).formatRange("2026-11-01", "2026-11-15")NumberFormat({style: "currency", currency: "QAR",
prefix: "فقط", suffix: "لا غير", brackets: "end"}).formatRange(1250.5, 2500)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)arqam.NumberFormat({style: "currency", currency: "QAR"}).formatRange(2000, 1000)arqam.NumberFormat().formatRange(5)arqam.NumberFormat().formatRange("x", 5)arqam.NumberFormat({style: "currency", currency: "QAR"}).formatRangeToParts(1, 2).map(p => p.source).join(" ")JSON.stringify(arqam.NumberFormat({style: "currency", currency: "QAR", brackets: "end"}).formatRangeToParts(1, 2).pop().parts.map(p => p.value))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.
| Family | The rule | approx | Example (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 preposition | the 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"})arqam("987450", {currency: "QAR", approx: "about", approxRound: 1})arqam("5000", {currency: "QAR", approx: "few"})arqam("23000", {currency: "QAR", approx: "plus"})arqam("150", {approx: "few"})arqam.NumberFormat({currency: "QAR", approx: "about"}).formatToParts(1000).map(p => p.type + ": " + p.value).join(" | ")approx: قرابة | literal: | integer: ألف | literal: | currency: ريال قطري«اشرح» 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]))Every value
approx | Words | Takes | Example |
|---|---|---|---|
"about" | قرابة · نحو · زهاء · حوالَيْ | any number of zero or more, decimals and % | 1000: قرابة ألف ريال سعودي |
"over" | ما يزيد على | the same | 1000: ما يزيد على ألف درهم إماراتي |
"under" | أقلّ من | the same | 1000: أقل من ألف دولار أمريكي |
"atLeast" | ما لا يقل عن | the same | 1000: ما لا يقل عن ألف جنيه مصري |
"atMost" | ما لا يزيد على | the same | 1000: ما لا يزيد على ألف درهم مغربي |
"few" | بضع / بضعة | whole numbers 3–9, 13–19, 23–99 (not ending in 0–2), times a thousand, a million …; 300–900 | 5000: بضعة آلاف ريال قطري |
"plus" | نيّف | whole numbers 21–99 not ending in 0, and a round hundred, thousand … with 1–9 more | 125: مائة ونيف وعشرون ريالًا سعوديًا |
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"})arqam.toDate("2026-11-24")arqam.toTime("2026-11-24T06:15:00Z")arqam.toTime("21:01")arqam.toDateTime("2026-11-23T19:30:00Z")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( lists them, and Intl.DateTimeFormat() gives the zone of the computer.
| Input | No locale, no timeZone | With a locale or a timeZone |
|---|---|---|
A plain date or time: "2026-11-24", "21:01" | as typed | the 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 Date | as written (a Date: the computer's clock); named only when zoneName is given | moved 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.
| Locale | Country | Time zone offset Jan / Jul | Currency | Month names | Digits and separators | zoneName: "city" (default) | zoneName: "country" |
|---|---|---|---|---|---|---|---|
ar-QA | Qatar | Asia/Qatar+3 / +3 | QAR | Gulf & Egypt | Arabic-Western 1,234.5 | بتوقيت الدوحة بِتَوْقِيتِ الدَّوْحَةِ | بتوقيت قطر بِتَوْقِيتِ قَطَرَ |
ar-BH | Bahrain | Asia/Bahrain+3 / +3 | BHD | Gulf & Egypt | Arabic-Western 1,234.5 | بتوقيت المنامة بِتَوْقِيتِ الْمَنَامَةِ | بتوقيت البحرين بِتَوْقِيتِ الْبَحْرَيْنِ |
ar-KW | Kuwait | Asia/Kuwait+3 / +3 | KWD | Gulf & Egypt | Arabic-Western 1,234.5 | بتوقيت الكويت بِتَوْقِيتِ الْكُوَيْتِ | بتوقيت الكويت بِتَوْقِيتِ الْكُوَيْتِ |
ar-AE | United Arab Emirates | Asia/Dubai+4 / +4 | AED | Gulf & Egypt | Arabic-Western 1,234.5 | بتوقيت أبوظبي بِتَوْقِيتِ أَبُوظَبْي | بتوقيت الإمارات بِتَوْقِيتِ الْإِمَارَاتِ |
ar-OM | Oman | Asia/Muscat+4 / +4 | OMR | Gulf & Egypt | Arabic-Western 1,234.5 | بتوقيت مسقط بِتَوْقِيتِ مَسْقَطَ | بتوقيت عُمان بِتَوْقِيتِ عُمَانَ |
ar-SA | Saudi Arabia | Asia/Riyadh+3 / +3 | SAR | Gulf & Egypt | Arabic-Eastern ١٬٢٣٤٫٥ | بتوقيت مكة المكرمة بِتَوْقِيتِ مَكَّةَ الْمُكَرَّمَةِ | بتوقيت السعودية بِتَوْقِيتِ السُّعُودِيَّةِ |
ar-YE | Yemen | Asia/Aden+3 / +3 | YER | Gulf & Egypt | Arabic-Eastern ١٬٢٣٤٫٥ | بتوقيت صنعاء بِتَوْقِيتِ صَنْعَاءَ | بتوقيت اليمن بِتَوْقِيتِ الْيَمَنِ |
ar-IQ | Iraq | Asia/Baghdad+3 / +3 | IQD | Levant & Iraq | Arabic-Eastern ١٬٢٣٤٫٥ | بتوقيت بغداد بِتَوْقِيتِ بَغْدَادَ | بتوقيت العراق بِتَوْقِيتِ الْعِرَاقِ |
ar-SY | Syria | Asia/Damascus+3 / +3 | SYP | Levant & Iraq | Arabic-Eastern ١٬٢٣٤٫٥ | بتوقيت دمشق بِتَوْقِيتِ دِمَشْقَ | بتوقيت سوريا بِتَوْقِيتِ سُورِيَا |
ar-LB | Lebanon | Asia/Beirut+2 / +3 (summer time) | LBP | Levant & Iraq | Arabic-Western 1,234.5 | بتوقيت بيروت بِتَوْقِيتِ بَيْرُوتَ | بتوقيت لبنان بِتَوْقِيتِ لُبْنَانَ |
ar-JO | Jordan | Asia/Amman+3 / +3 | JOD | Levant & Iraq | Arabic-Eastern ١٬٢٣٤٫٥ | بتوقيت عمّان بِتَوْقِيتِ عَمَّانَ | بتوقيت الأردن بِتَوْقِيتِ الْأُرْدُنِّ |
ar-PS | Palestine | Asia/Hebron+2 / +3 (summer time) | ILS | Levant & Iraq | Arabic-Eastern ١٬٢٣٤٫٥ | بتوقيت القدس بِتَوْقِيتِ الْقُدْسِ | بتوقيت فلسطين بِتَوْقِيتِ فِلَسْطِينَ |
ar-EG | Egypt | Africa/Cairo+2 / +3 (summer time) | EGP | Gulf & Egypt | Arabic-Eastern ١٬٢٣٤٫٥ | بتوقيت القاهرة بِتَوْقِيتِ الْقَاهِرَةِ | بتوقيت مصر بِتَوْقِيتِ مِصْرَ |
ar-SD | Sudan | Africa/Khartoum+2 / +2 | SDG | Gulf & Egypt | Arabic-Eastern ١٬٢٣٤٫٥ | بتوقيت الخرطوم بِتَوْقِيتِ الْخُرْطُومِ | بتوقيت السودان بِتَوْقِيتِ السُّودَانِ |
ar-LY | Libya | Africa/Tripoli+2 / +2 | LYD | Gulf & Egypt | Arabic-Western 1.234,5 | بتوقيت طرابلس بِتَوْقِيتِ طَرَابُلُسَ | بتوقيت ليبيا بِتَوْقِيتِ لِيبِيَا |
ar-TN | Tunisia | Africa/Tunis+1 / +1 | TND | North Africa | Arabic-Western 1.234,5 | بتوقيت تونس بِتَوْقِيتِ تُونِسَ | بتوقيت تونس بِتَوْقِيتِ تُونِسَ |
ar-DZ | Algeria | Africa/Algiers+1 / +1 | DZD | North Africa | Arabic-Western 1.234,5 | بتوقيت الجزائر بِتَوْقِيتِ الْجَزَائِرِ | بتوقيت الجزائر بِتَوْقِيتِ الْجَزَائِرِ |
ar-MA | Morocco | Africa/Casablanca+1 / +1 | MAD | Morocco | Arabic-Western 1.234,5 | بتوقيت الرباط بِتَوْقِيتِ الرِّبَاطِ | بتوقيت المغرب بِتَوْقِيتِ الْمَغْرِبِ |
ar-MR | Mauritania | Africa/Nouakchott0 / 0 | MRU | North Africa | Arabic-Western 1,234.5 | بتوقيت نواكشوط بِتَوْقِيتِ نُوَاكْشُوطَ | بتوقيت موريتانيا بِتَوْقِيتِ مُورِيتَانْيَا |
ar-SO | Somalia | Africa/Mogadishu+3 / +3 | SOS | Gulf & Egypt | Arabic-Western 1,234.5 | بتوقيت مقديشو بِتَوْقِيتِ مُقَدِيشُو | بتوقيت الصومال بِتَوْقِيتِ الصُّومَالِ |
ar-DJ | Djibouti | Africa/Djibouti+3 / +3 | DJF | Gulf & Egypt | Arabic-Western 1,234.5 | بتوقيت جيبوتي بِتَوْقِيتِ جِيبُوتِي | بتوقيت جيبوتي بِتَوْقِيتِ جِيبُوتِي |
ar-KM | Comoros | Indian/Comoro+3 / +3 | KMF | Gulf & Egypt | Arabic-Western 1,234.5 | بتوقيت موروني بِتَوْقِيتِ مُورُونِي | بتوقيت جزر القمر بِتَوْقِيتِ جُزُرِ الْقَمَرِ |
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 zone | Offset Jan / Jul | "city" | "country" |
|---|---|---|---|
Europe/London | 0 / +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) | بتوقيت أوكلاند بِتَوْقِيتِ أُوكْلَانْدَ | بتوقيت نيوزيلندا بِتَوْقِيتِ نِيُوزِيلَنْدَا |
UTC | 0 / 0 | بتوقيت غرينتش بِتَوْقِيتِ غْرِينِتْشَ | بتوقيت غرينتش بِتَوْقِيتِ غْرِينِتْشَ |
Options and functions
| Name | Values | Default | What 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 array | the 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 null | your 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.regions | the 22 locales and what each gives (the table above) | ||
arqam.timeZones | every 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
| Order | Source | Example |
|---|---|---|
| 1 | an option in the call | toWords("5", {currency: "MAD"}) |
| 2 | an option in config() or the instance, given with the locale or after it | config({locale: "ar-KW", arabicNumbers: "off"}) |
| 3 | the locale's defaults | config({locale: "ar-MA"}) → MAD, Morocco month names, 1.500,50, Africa/Casablanca |
| 4 | Arqam's defaults | no 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"})arqam("1500.5", {locale: "ar-KW", style: "currency", brackets: "end"})arqam("1500.5", {locale: "ar-MA", style: "currency", brackets: "end"})arqam.toDate("2026-11-24", {locale: "ar-IQ"})arqam.toDate("2026-07-20", {locale: "ar-MA"})arqam("99.5", {locale: "ar-QA", currency: "MAD"})arqam.toTime("2026-11-24T06:15:00Z", {locale: "ar-SA"})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"})arqam.toDateTime("2026-11-23T19:30:00Z", {timeZone: "Asia/Qatar"})arqam.toDateTime("2026-11-24T01:30:00Z", {timeZone: "Europe/London"})["ar-QA", "ar-EG", "ar-AE"].map(l => arqam.toTime("2026-11-24T06:15:00Z", {locale: l}))arqam.toTime("2026-01-15T12:00:00Z", {locale: "ar-EG", zoneName: "both"})arqam.toTime("2026-07-15T12:00:00Z", {locale: "ar-EG", zoneName: "both"})arqam.toTime("2026-03-01T12:00:00Z", {locale: "ar-MA", zoneName: "both"})arqam.toTime("2026-11-24T06:15:00Z", {timeZone: "Asia/Kolkata", zoneName: "both"})arqam.toTime("2026-11-24T06:15:00Z", {timeZone: "Asia/Kathmandu", zoneName: "both"})arqam.toDate("2026-11-23T22:30:00Z", {calendar: "both", locale: "ar-QA"})arqam.toTime("2026-11-23T22:30:00+03:00")arqam.toTime("2026-11-23T22:30:00+03:00", {zoneName: "offset"})arqam.toDate("20261124T061500Z")arqam.toTime("2026-11-24T06:15:00Z", {timeZone: "America/Denver"})arqam.toTime("2026-11-24T06:15:00Z", {timeZone: "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: بتوقيت الدوحة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(" · ")arqam.toTime("2026-11-24T06:15:00Z", {timeZone: "Asia/Doha", strict: "on"})arqam.config({locale: "ar-XX"})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(" ")[...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(" ")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: "كتب"})arqam.utils.count(11, {single: "سيارة", plural: "سيارات", gender: "feminine"})arqam.utils.count(2, {single: "كتاب", plural: "كتب"})arqam.utils.count(25, {
single: "طالب",
plural: "طلاب",
singleT: "طَالِب",
pluralT: "طُلَّابٍ",
tashkeel: "full",
ierab: "jarr"
})arqam.utils.cardinal(13, {gender: "feminine"})arqam.utils.ordinal(21, {gender: "feminine", definite: false})arqam.utils.percent(25)arqam.utils.scaleName(3, {plural: true})arqam.utils.toCase("السادسُ والعشرونَ من شهرِ نوفمبرَ", "jarr")Reading and calendars
JSON.stringify(arqam.utils.parseDate("26/11/2026"))JSON.stringify(arqam.utils.parseDate("1 رمضان 1447", {input: "h"}))JSON.stringify(arqam.utils.parseTime("3:15 م"))JSON.stringify(arqam.utils.parseFraction("3½"))JSON.stringify(arqam.utils.hijri("2026-11-26"))JSON.stringify(arqam.utils.fromHijri(1447, 9, 1))(() => { try { arqam.utils.parseDate("30/02/2026"); } catch (e) { return e.message; } })()Text
arqam.utils.normalize("أَلْفٌ وَمِائَةُ مُؤَسَّسَة")arqam.utils.digits("١٢٣٫٥")arqam.utils.digits("2026", "eastern")arqam.utils.suggest("tashkel", Object.keys(arqam.defaults))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(", ")JSON.stringify(arqam.utils.options.options.ierab)12.27 Good to know
- Every call starts and ends with the same settings: a one-off option, and the engine's own working changes, never reach the next call.
- Speed: about 16 µs a call; switching tashkeel or scale between calls costs about 30 µs (the scale tables are kept per tashkeel and scale).
- Extra decimal digits are cut, never rounded, unless rounding is on; the figure in brackets is cut the same way.
- Show the words with
dir="rtl". A figure in brackets inside them can read «(QAR 1,250.50-)»: isolate it as left-to-right, e.g.words.replace(/\([^)]*\)/, m => "<bdi dir=ltr>" + m + "</bdi>"), or lay outtoParts().bracketsyourself. - The words are in Arabic; for English words use the sister library arqamEN (
dist/arqamEN.mjs). - Browsers: any that support ES2020 (BigInt). No network, no storage, no globals from the module.
- Each release is listed in
CHANGELOG.md; publish each one under its own path (/arqam/2.0.0/) so pages pinned to a version keep working.
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"})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>#Q2Q3How 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"}); // خمسة وعشرون دولارا أمريكيا#Q3Q4How 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"}));
})();#Q5Q6Is 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) === arqamARarqam("1250.50", "ar-QA", {style: "currency"}) === arqam("1250.50", {currency: "QAR"})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.
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#Q8Q9Does 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.
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").ararqam.toBilingual("1250.50", "QAR").enQ11Can 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]arqam.toClause("cheque", "2500", "KWD", {payee: "Al Noor Est.", lang: "en"}).lines[1]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"}).issuewordsToNumbers.verify("ألف ومائتان وخمسون ريالا قطريا، وخمسون درهما", "1250.75", {currency: "QAR"}).differenceQ13Why 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")arqam("1250", "en-GB")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.
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")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"})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"})Q18Which version am I using?Beginner
arqam.version gives the engine version.
The releases are listed in CHANGELOG.md.
arqam.versionQ19Does 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.
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.
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);#Q21Q22Is 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.
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>;
}#Q24Q25Is Arqam free to use in commercial products?Beginner
Yes: it is under the MIT licence (see LICENSE).
Keep the licence notice with the files.
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.
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"}));#Q27Q28Can 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.
#Q28Q29How 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()#Q3013.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")arqam(12345678901234567890)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})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)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, ""))Q35What happens with spaces around the number?Beginner
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)Q37What about a plus sign?Beginner
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"})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: "غير صالح"})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"})arqam(0)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)))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"});#Q42Q43What 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))arqam("1" + "0".repeat(6000), {scale: "long"})arqam("9".repeat(10000)).lengtharqam(10n ** 40n)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})arqam("3.14159265358979323846", {maximumFractionDigits: 20})arqam("3.14159", {decRound: 2})arqam("1.005", {currency: "QAR"})arqam("1.2345", {currency: "KWD"})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)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([])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).
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"})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"})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%")Q51What about a negative number with spaces, "- 5"?Intermediate
Q52Is a number with a trailing minus (5-) accepted?Intermediate
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(",", "."))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"})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, ""))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")arqam(["5", "x"])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>#Q57Q58How 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"})arqam("5", {currency: "QAR", brackets: "start"})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"})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) |
valid | true |
negative | true |
percent | false |
ordinal | "" |
prefix | فقط |
sign | سالب |
whole | ألف ومائتين وخمسين ريالًا قطريًا |
fraction | ، وخمسين درهمًا |
suffix | لا غير |
brackets | "(-1,250.50 QAR)" |
figure | "-1,250.50 QAR" |
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").validarqam.toParts("12").validQ62Can 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: "[]"})arqam("5", {currency: "QAR", brackets: "end", bracketsType: "«»"})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"})arqam("12.5", {currency: "QAR", brackets: "end", numSymbol: "latin"})arqam("12.5", {currency: "QAR", brackets: "end", numSymbol: "none"})arqam("12.5", {currency: "QAR", brackets: "end", numSymbol: "ريال"})arqam("12.5", {currency: "SAR", brackets: "end", numSymbol: "sign"})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: ","})arqam("1234.5", {currency: "SAR", brackets: "end", sepThousands: "fr"})Q65Can the figure in brackets use Arabic-Eastern digits?Intermediate
Yes, with arabicNumbers: "on".
arqam("1234.5", {currency: "AED", brackets: "end", arabicNumbers: "on"})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"})arqam("1234", {currency: "QAR", brackets: "end", currDecForce: "off"})Q67Can I put only the fraction in brackets?Intermediate
brackets: "decimals" puts the fraction's words in brackets.
arqam("5.25", {brackets: "decimals"})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"}).wholearqam.toParts("1250.5", {currency: "QAR"}).fractionQ69Does 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)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.
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.
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.
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"arqam("9".repeat(30), {compact: "on"})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"}).figurearqam.toParts("21", {ordinal: "masculine", brackets: "end"}).figure13.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"}))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, "&").replace(/</g, "<").replace(/>/g, ">");
// 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>";
}#Q76Q77How 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"}))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")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"}))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"})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"}))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"}))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>")nasb: اثْني عَشَر رِيَالا قَطَرِيا
jarr: اثْني عَشَر رِيَالا قَطَرِيا
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, "")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"})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} }#Q87Q88Does 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"}))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.
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).
#Q90Q91Can 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');
}#Q91Q92How 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.
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["QAR", "SAR", "EUR", "BTC", "XYZ"].map(c => c + ": " + (c in arqam.currencies)).join(", ")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"})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"})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"})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"})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"})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"})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"})arqam("2.675", {currency: "QAR", rounding: "off"})arqam("9.999", {currency: "QAR"})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"})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"})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"})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"})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"})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"})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"})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"})arqam.registerCurrency("ABC", {majorSingle: "كتاب"})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"})arqam("7.5", {currency: "ZZS", brackets: "end", numSymbol: "latin"})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)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")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"})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)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"})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"})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"})Q118Can one call write two currencies?Intermediate
No; call once per currency and join the texts.
arqam("100", {currency: "USD"}) + " أو ما يعادلها " + arqam("364", {currency: "USD"})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"})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.
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"})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"})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"})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"})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"})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"})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"})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"})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"})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"})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"})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"})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"})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"})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"})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"})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"})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"})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"})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"})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"})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"})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"})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"})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"})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"})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"})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"})Q149How do I get full tashkeel?Beginner
tashkeel: "full" (or the short code "f").
arqam("1234.56", {currency: "MAD", tashkeel: "full"})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)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"})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"})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"})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"})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"})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"})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"})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"})arqam.reset()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: "لا غير"})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"})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: "لا غير"})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")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"})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(" ")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"})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: "دفعتُ"})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"})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"})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"})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(" | ")واحد: مرفوع بالضمة الظاهرة | وعشرون: الواو حرف عطف؛ معطوف مرفوع بالواو لأنه ملحق بجمع المذكر السالم | ريالًا: تمييز منصوب بالفتحة الظاهرة | قطريًا: نعت لـ«ريال» يتبعه (منصوب بالفتحة الظاهرة)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"])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"})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"})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"})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"})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"})Q177Is إحدى used with feminine nouns?Advanced
Yes: إحدى عشرة, and إحدى وعشرون with a feminine currency.
arqam("21", {currency: "SYP"})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"})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"})Q180How are one and two written?Beginner
واحد/واحدة and اثنان/اثنتان follow the noun with a currency: ريال واحد، ليرتان اثنتان.
arqam("1", {currency: "SYP"})arqam("2", {currency: "SYP"})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"})Q182How are eleven and twelve written?Beginner
أحد عشر/إحدى عشرة, اثنا عشر/اثنتا عشرة; the noun singular and accusative.
arqam("11", {currency: "QAR"})arqam("12", {currency: "SYP"})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"})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"})Q185How are the hundreds written?Beginner
مائة، مائتان، ثلاثمائة … تسعمائة; the noun singular and genitive.
arqam("100", {currency: "AED"})arqam("200", {currency: "AED"})arqam("300", {currency: "AED"})Q186How are the thousands written?Beginner
ألف، ألفان، ثلاثة آلاف، أحد عشر ألفا، مائة ألف.
arqam(["1000", "2000", "3000", "11000", "100000"])Q187How are millions and billions written?Beginner
مليون، مليونان، ثلاثة ملايين … مليار.
arqam(["1000000", "2000000", "3000000", "1000000000"])Q188How are 101, 1,001 and 1,000,001 written?Intermediate
Answered in Q172: How is 1,000,001 written?
#Q188Q189How are 110, 120 and 150 written?Intermediate
مائة وعشرة، مائة وعشرون، مائة وخمسون.
arqam(["110", "120", "150"], {currency: "USD"})Q190How are 1,100 and 1,200 written?Intermediate
ألف ومائة، ألف ومائتان.
arqam(["1100", "1200"], {currency: "EGP"})Q191How is 999,999 written?Intermediate
The largest number below a million.
arqam("999999")Q192How are 10,000 and 100,000 written?Intermediate
عشرة آلاف، مائة ألف.
arqam(["10000", "100000"], {currency: "MAD"})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"})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"})Q195How are a trillion and larger numbers written?Advanced
تريليون, then كوادرليون, كوينتليون … with the Arabic scale.
arqam(["1000000000000", "1000000000000000", "1000000000000000000"])Q196What does a number with every group filled look like?Advanced
All the rules at once.
arqam("987654321123.45", {currency: "SAR"})Q197And the same number in full tashkeel?Advanced
Useful to see the case endings.
arqam("987654321123.45", {currency: "SAR", tashkeel: "full"})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"})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"})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"})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"})arqam("1234567.5", {currency: "AED", compact: "on"})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))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"})Q204Is مليار the same as billion?Beginner
Yes, 10⁹. With the Arabic scale it is مليار; بليون is used with the short scale.
arqam("1000000000")Q205How is a trillion written?Intermediate
تريليون (10¹² in the Arabic and short scales).
arqam("2500000000000", {currency: "USD"})Q206Does legal apply to millions too?Intermediate
Q207Can compact be used with tashkeel?Intermediate
Yes; the words get their marks and the figures stay figures.
arqam("1234567", {compact: "on", tashkeel: "full"})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))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")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"})arqam("12.75", {decFormat: "digits"})arqam("12.75", {decFormat: "decimal"})arqam("12.75", {decFormat: "slash"})Q211How do I say «صفر» before a fraction of one?Beginner
Q212How do I use «فاصلة» instead of «و»?Intermediate
decFaslah: "on", or a decFormat such as "words" that uses فاصلة.
arqam("12.75", {decFaslah: "on"})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"})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"})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"})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"})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")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"})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"})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")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"})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"})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)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")Q225How are tenths to thousandths written?Intermediate
As parts of ten, hundred, thousand …
arqam(["0.1", "0.01", "0.001", "0.0001"])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")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"])Q228Is 2/2 or 0/5 accepted by toFraction()?Intermediate
Q229Can toFraction() write a negative fraction?Intermediate
No; write «سالب» yourself before the words.
arqam.toFraction("-3/4")"سالب " + arqam.toFraction("3/4")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"})Q231Can toFraction() use full tashkeel?Advanced
Yes.
arqam.toFraction("2/3", {tashkeel: "full"})arqam.toFraction("3 1/2", {tashkeel: "full"})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"})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%")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"})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"})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"})Q237Can I write an ordinal without الـ?Intermediate
ordinalDefinite: "off": أول، ثانٍ، حادٍ وعشرون.
arqam("21", {ordinal: "masculine", ordinalDefinite: "off"})arqam("2", {ordinal: "feminine", ordinalDefinite: "off"})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"})Q239Is a percentage written with a currency?Intermediate
No: the currency is ignored, because a percentage is not an amount.
arqam("25%", {currency: "QAR"})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"})Q241How is minus a fraction written, such as -0.5?Beginner
Q242Does a negative amount keep the minus in the brackets?Intermediate
Yes, before the figure.
arqam("-12.5", {currency: "SAR", brackets: "end"})Q243How is 100% written, and 0%?Intermediate
Q244Can a percentage have tashkeel?Intermediate
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"})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"})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: "لا غير"})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"
})Q249How do I write the amount in an invoice line «المبلغ بالحروف»?Beginner
Usually the plain words with the currency, nominative.
"المبلغ بالحروف: " + arqam("3450.75", {currency: "AED"})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"})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"})fullarqam.removeTashkeel(full)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("، ")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"])arqam.reset()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: "لا غير"})Q256How do I write an amount in a sentence after «بمبلغ»?Intermediate
Use the genitive.
"بمبلغ " + arqam("2000", {currency: "USD", ierab: "jarr"})Q257How do I write a percentage in a contract?Intermediate
Percentage words, with the figure in brackets.
"بنسبة " + arqam("12.5%", {ierab: "jarr", brackets: "end"})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(" | ")الدفعة الأولى: اثنا عشر ألفًا وخمسمائة جنيه مصري | الدفعة الثانية: اثنا عشر ألفًا وخمسمائة جنيه مصري | الدفعة الثالثة: اثنا عشر ألفًا وخمسمائة جنيه مصري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"})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"})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"})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 = ألف وتسعمائة وتسعة وتسعون ريالًا قطريًا، وتسعة وتسعون درهمًا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")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"})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"})arqam.toDate("18/11/2026", {style: "compact"})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"})arqam.toDate("05/06/2026", {order: "mdy", style: "compact"})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"})arqam.toDate("1/8/2026", {months: "both", style: "compact"})arqam.toDate("1/1/2026", {months: "maghreb", style: "compact"})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"})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"})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هـ")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"})arqam.toDate("18/11/1447 AH", {style: "compact"})arqam.toDate("18/11/2026م", {style: "compact"})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"})arqam.toDate("10 ذي الحجة 1447", {calendar: "b", style: "compact"})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"})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"})arqam.toDate("18 نوفمبر 2026هـ", {strict: "on"})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هـ"))new arqam.NumberFormat({style: "date", calendar: "gregory"}).format("18/11/1447هـ")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")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"})Q278How do I write «غرة» for the first day?Intermediate
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"})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"})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))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"})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"})arqam.toDate("29/2/2023", {style: "compact"})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")Q285Can a compact date use Arabic-Eastern digits?Intermediate
arabicNumbers: "on".
arqam.toDate("18/11/2026", {calendar: "h", style: "compact", arabicNumbers: "on"})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.
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"})arqam.toDate("١٨/١١/٢٠٢٦", {style: "compact"})arqam.toDate("18/11/26")Q288How do I write today's date?Beginner
Q289How are the months named in Morocco?Intermediate
months: "morocco": يناير، فبراير … يوليوز، غشت، شتنبر … دجنبر.
arqam.toDate("1/8/2026", {months: "morocco", style: "compact"})arqam.toDate("1/12/2026", {months: "morocco", style: "compact"})Q290Can I write the year with «عام»?Intermediate
year: "aam".
arqam.toDate("18/11/2026", {year: "aam"})Q291How do I write the date with full tashkeel?Intermediate
tashkeel: "full".
arqam.toDate("18/11/2026", {tashkeel: "full"})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"})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"})arqam.toDate("1/1/622", {calendar: "h"})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"})arqam.toDate("18/11/2026", {style: "compact", era: "none"})Q295Is the date in words agreed with the year word?Advanced
Yes: لعام … للميلاد, سنة … ميلادية, عام … ميلادي; the number agrees with سنة (feminine).
arqam.toDate("18/11/2026", {year: "sana"})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(" ")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")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"})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"})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"})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"})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"})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"})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"})Q305Can I get the time with full tashkeel?Advanced
Yes, toTime() shares the tashkeel options.
arqam.toTime("15:45", {tashkeel: "full"})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("٣:١٥")Q307Can I write several times at once?Intermediate
Pass an array; you get an array.
arqam.toTime(["1:00", "13:35", "18:00"])Q308How are noon and midnight written?Beginner
12:00 is ظهرًا; 0:00 is «منتصف الليل».
arqam.toTime("12:00")arqam.toTime("0:00")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"])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"})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"})Q312How are the seconds written?Intermediate
After the minutes, when they are not 00.
arqam.toTime("10:05:09")Q313Can I pass a Date object to toTime()?Intermediate
Yes: its local time is used.
arqam.toTime(new Date(2026, 0, 1, 15, 45))Q314How do I write the time without the word الساعة?Intermediate
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"})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"})Q317Can toTime() return «دقيقة» with tanween?Advanced
With tashkeel "alif" or more, the accusative noun takes it.
arqam.toTime("3:15", {tashkeel: "alif"})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"})arqam("30")arqam.reset()Q319How do I go back to the defaults?Beginner
reset(). Registered currencies stay.
arqam.config({tashkeel: "full", currency: "KWD"})arqam.reset()arqam("3")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().tashkeelarqam.reset()Q321Where are the defaults listed?Beginner
arqam.defaults (a copy), and the table in 12.10.
arqam.defaults.tashkeel === "" && arqam.defaults.ierabQ322Do 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"})arqam("5")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")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().toDateQ325Is 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.
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"})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().ierabarqam.reset()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")inv.reset()inv.toWords("12.5")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()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.
#Q330Q331How much does an instance cost?Advanced
Very little: it keeps only its options.
Make one per tenant or document type and keep it.
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)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"})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(", ")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})Q336What happens with a wrong value?Intermediate
A TypeError that lists every accepted value, as the name and the code.
arqam("5", {tashkeel: "x"})arqam("5", {ierab: "accusative"})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"})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).lengthQ339Are 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"})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"})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"})Q342What does ierab do?Beginner
The case: raf (default), nasb, jarr.
arqam("22", {currency: "KWD", ierab: "jarr"})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"})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: "لا غير"})Q345What does legal do?Beginner
The scale word repeated after hundreds: none (default), auto, full.
arqam("102000", {legal: "full"})Q346What does decFormat do?Beginner
The form of the decimal part (ten values; see 12.13).
arqam("3.5", {decFormat: "figures"})Q347What does rounding do?Beginner
Round extra decimals half up instead of cutting them.
arqam("3.456", {currency: "QAR", rounding: "on"})Q348What does percent do?Beginner
Q349What do ordinal and ordinalDefinite do?Beginner
The ordinal (masculine or feminine), with or without الـ.
arqam("3", {ordinal: "feminine", ordinalDefinite: "off"})Q350What does bracketsType do?Intermediate
The two bracket characters (default "()").
arqam("3", {currency: "KWD", brackets: "end", bracketsType: "{}"})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"})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"})arqam("12345.5", {currency: "KWD", brackets: "end", sepThousands: "de"})Q353What does arabicNumbers do?Intermediate
Arabic-Eastern digits in the figure in brackets.
arqam("12.5", {currency: "KWD", brackets: "end", arabicNumbers: "on"})Q354What does currDecForce do?Intermediate
Show the currency's places in the figure (default on).
arqam("12", {currency: "KWD", brackets: "end", currDecForce: "off"})Q355What does scale do?Intermediate
The names of large numbers: arabic (default), short, long.
arqam("3000000000", {scale: "short"})Q356What does compact do?Intermediate
Q357What does comma do?Intermediate
The Arabic comma before و between groups (default off; switch it on to use it).
arqam("3500000", {comma: "on"})Q358What do miah and miahSplit do?Intermediate
مائة or مئة, and the hundreds written apart.
arqam("500", {miah: "off", miahSplit: "on"})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"})Q360What does addZero do?Intermediate
«صفر» before a fraction of one.
arqam("0.25", {addZero: "on"})Q361What does decJuz do?Intermediate
Q362What does decAL do?Intermediate
Q363What does decFaslah do?Intermediate
«فاصلة» before the fraction instead of «و».
arqam("3.25", {decFaslah: "on"})Q364What does decIgnore do?Intermediate
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})Q366What does ignoreCountry do?Intermediate
The currency name without its country.
arqam("3", {currency: "EGP", ignoreCountry: "on"})Q367What does isNaN do?Intermediate
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"})arqam("abc", {strict: "on"})arqam(Infinity, {strict: "on"})Q369What does split do?Intermediate
Colour markers in the words (see "Colouring").
arqam("3.5", {currency: "QAR", split: "on"})ثلاثة|c ريالات قطرية|p، و|f||f|خمسون |cدرهمًاQ370What does wordOrder do?Intermediate
"small": the smallest part first (classical); "" or "large": the largest first.
arqam("3500", {wordOrder: "small"})Q371What does majorGender (without a code) do?Intermediate
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: "كاكات"
})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"})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"})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"})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"})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"})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"})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"})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(", ")Q381What do toDate(date, [options]) give?Beginner
A date in words; an array gives an array.
arqam.toDate("7/7/2027", {style: "compact"})Q382What do toTime(time, [options]) give?Beginner
A time or a duration in words; an array gives an array.
arqam.toTime("7:07")Q383What do toFraction(fraction, [options]) give?Beginner
Q384What does config(options) give?Beginner
Sets standing options; returns nothing.
arqam.config({currency: "BHD"})arqam("7")arqam.reset()Q385What does reset() give?Beginner
Back to the defaults; registered currencies stay.
arqam.config({currency: "BHD"})arqam.reset()arqam.options().currencyQ386What does options() give?Beginner
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")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: "كوكوات"}))Q389What do removeTashkeel(text, [options]) give?Intermediate
The text without its marks; an array gives an array.
arqam.removeTashkeel(["سَبْعَةٌ", "ثَمَانِيَةٌ"])Q390What do nisba(name, [options]) give?Intermediate
The نسبة adjective of a place name; feminine with {feminine: true}.
arqam.nisba("الأردن")arqam.nisba("الأردن", {feminine: true})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"Q392What do fromWords(text, [options]) give?Intermediate
With the reader loaded: the number in the words, as text, or null.
arqam.fromWords("سبعة آلاف وسبعون")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(", ")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").okQ395What do explain(number, [options]) give?Intermediate
With explain loaded: the grammar of every word.
arqam.explain("7", {currency: "BHD"}).words.lengthQ396What do explain.date(date, [options]) give?Intermediate
With explain loaded: the grammar of the words of a date.
arqam.explain.date("7/7/2027").textQ397What 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("سبعة وسبعون")wordsToNumbers.value("سبعة وسبعون")wordsToNumbers.versionQ398What 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.versionarqamExplain.rules[arqam.explain("5", {currency: "MAD"}).order[0]].titleQ399Which 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.
#Q399Q400What 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.SARObject.keys(arqam.signs).lengtharqam("5", {currency: "SAR", numSymbol: "sign", brackets: "end"})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).lengtharqam.regions["ar-QA"].currency + " · " + arqam.regions["ar-QA"].months + " · " + arqam.regions["ar-QA"].cityQ402What 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).lengtharqam.timeZones["Asia/Qatar"].city + " · " + arqam.timeZones["Asia/Qatar"].countryQ403What 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"})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")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"})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 م"))JSON.stringify(arqam.utils.parseTime("2:30", {duration: true}))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"))JSON.stringify(arqam.utils.parseFraction("6/8", {fractionSimplify: "on"}))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]arqam.utils.fromHijri(1447, 2, 30)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("احدي عشره")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"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"])arqam.utils.suggest("QRR", ["QAR", "SAR", "USD"])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)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"})Q414What does strict: "on" do?Beginner
Answered in Q368: What does strict do?
#Q414Q415How 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);
}#Q415Q416Are 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"})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})arqam("x", {isNaN: "—"})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: "كوكو"})arqam.registerCurrency("ZZE", {majorSingle: "كوكو", majorPlural: "كوكوات", currDecimal: 40})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"})arqam.options().tashkeelarqam.reset()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"})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"})arqam.toTime("noon", {strict: "on"})Q422Does strict apply to an array?Intermediate
Yes: the first bad item throws.
arqam(["5", "x"], {strict: "on"})Q423Are the error messages in English?Intermediate
Yes, for developers; show your users your own message.
#Q423Q424Does 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 "})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; } })()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"})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"})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"})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"))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"})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"})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"})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"})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"})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("ألفان وخمسمائة")arqam.fromWords("مليون ونصف")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("لدي ثلاثة وعشرون كتابا")wordsToNumbers("دفعت ألفين وخمسمائة ريال وخمستاشر درهم")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("الثامن عشر من شهر نوفمبر لعام ألفين وستة وعشرين للميلاد")wordsToNumbers("غرة شهر رمضان لعام ألف وأربعمائة وسبعة وأربعين")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("الساعة الثالثة وخمس عشرة دقيقة عصرًا")wordsToNumbers("ساعتان ونصف")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("الساعة الثالثة وخمس عشرة دقيقة"))wordsToNumbers("الساعة الثالثة وخمس عشرة دقيقة مساءً")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("انتظرت عشر دقائق")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("الثامن عشر من شهر ذي القعدة لعام ألف وأربعمائة وسبعة وأربعين"))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"})wordsToNumbers("الساعة الثالثة وخمس عشرة دقيقة", {times: "off"})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"})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])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"})arqam.verify("خمسون ريالا قطريا", "40", {currency: "QAR"})Q446Does the reader understand dialects and tashkeel?Intermediate
It reads common dialect forms (خمستاشر، ميتين) and ignores tashkeel and tatweel.
arqam.fromWords("خمستاشر")arqam.fromWords("أَلْفَانِ")Q447Can the reader give Arabic-Eastern digits?Intermediate
arabicNumbers: "on".
wordsToNumbers("لدي ثلاثة وعشرون كتابا", {arabicNumbers: "on"})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"}))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"}))Q450Can it read ordinals and zero?Advanced
With ordinals: "on" and zero: "on".
wordsToNumbers("الفصل الحادي عشر", {ordinals: "on"})wordsToNumbers("صفر", {zero: "on"})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"})Q452What does fromWords() return when there is no number?Beginner
Q453Does the reader read negatives and percentages?Intermediate
Q454Does it read «ونصف» and «وربع»?Intermediate
Q455Does it read the dialect forms of hundreds?Intermediate
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].currencyarqam.verify("ألف ريال", "1000", {currency: "SAR"}).okQ457Can I read with the long scale?Intermediate
Q458Can it read words that are also ordinary words?Intermediate
With ambiguous: "on" it also reads such words alone.
wordsToNumbers("مياه")wordsToNumbers("مياه", {ambiguous: "on"})Q459What does verify() return when the words name no number?Advanced
ok false and reason "none".
arqam.verify("مرحبا", "5")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(", ")Q461Does fromWords() understand the classical order?Advanced
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("مائة وألف")wordsToNumbers("مائة وألف", {order: "small"})wordsToNumbers("اثنان وعشرون وتسعمائة وألف")arqam("101000", {legal: "auto"})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(" | ")ثلاثة — مرفوع بالضمة الظاهرة، وهو مضاف | دولارات — مضاف إليه مجرور بالكسرة | أمريكية — نعت لـ«دولار» يتبعه (مجرور بالكسرة)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"});#Q464Q465Can 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(" | ")الثامن — الجزء الأول من عدد ترتيبي مركب مبني على فتح الجزأين في محل رفع خبر لمبتدأ محذوف تقديره «اليومُ» | عشر — الجزء الثاني من عدد ترتيبي مركب مبني على الفتح | من — حرف جر مبني على السكون، لا محل له من الإعراب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(" | ")من — حرف جر مبني على السكون، وحُرّك بالفتح لالتقاء الساكنين، لا محل له من الإعراب | الساعة — مجرور بـ«من» وعلامة جره الكسرة الظاهرة | التاسعة — نعت لـ«الساعة» مجرور بالكسرة الظاهرة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"})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].shortQ469What 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(", ")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: مفرد مجرورQ471Can explain() explain an ordinal?Intermediate
Q472What does explain() give for a bad number?Intermediate
text "" and empty lists.
arqam.explain("abc").text === "" && arqam.explain("abc").words.lengthQ473How many grammar rules does explain know?Advanced
Q474Where is the reason for a word's form?Advanced
In why.
arqam.explain("5", {currency: "USD"}).words[0].why13.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");#Q475Q476How 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}); }
});#Q476Q477How 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"});
}#Q477Q478Can 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));#Q478Q479Does 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.
#Q479Q480How 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.
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>#Q481Q482How 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درهمًاQ483Is there an English version?Advanced
Yes: arqam/en (arqamEN) writes numbers and amounts in English words.
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();#Q484Q485Can 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"});
});#Q485Q486How do I use it in Vue?Intermediate
Call it in a computed property.
const words = computed(() => toWords(amount.value, {currency: "MAD"}));#Q486Q487How 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); }
}#Q487Q488How 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>#Q488Q489Can 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.
#Q489Q490How 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.
#Q491Q492How 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);#Q49213.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.
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"})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"})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().
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.
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("مرحبا")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.versionQ501A 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")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"})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".
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.
#Q504Q505The 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".
Q506explain or fromWords is undefined.Intermediate
Load the explain or reader file after the engine (or import their modules).
#Q506Q507The 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.
Q508A registered currency disappeared.Advanced
It lasts for the session only; register it again when your program starts.
#Q50813.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"})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)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)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)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)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"})arqam.config({locale: "ar-KW"})arqam.NumberFormat({style: "currency"}).format(2)arqam.reset()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%")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)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.lengthObject.keys(arqam.units.intl).lengtharqam.units.key("kilometer-per-hour")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")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)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)arqam.NumberFormat({currency: "USD", currency: "QAR"}).format(3)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)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)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})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())JSON.stringify(arqam.NumberFormat({style: "date", calendar: "hijri"}).resolvedOptions())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()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))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"]))arqam.NumberFormat("en-GB")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"})arqam.NumberFormat({fractionForm: "parts"})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.
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);#Q530Q531Which 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.versionQ532Which 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"})arqam.NumberFormat("ar-u-nu-arab", {brackets: "end"}).format(3.1)arqam("1000000.5", {
currency: "EGP",
brackets: "end",
arabicNumbers: "on",
sepThousands: ",",
sepDecimal: "."
})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: درهمًا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))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(" | ")مليونان | خمسمائة ألف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))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: عصرًا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)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)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)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)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)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")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")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: ريال قطري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")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"}).wholeQ548What 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")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).methodnew arqam.NumberFormat({style: "date"}).plan("2026-11-27").methodQ550Does 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)new arqam.NumberFormat("ar-QA", {localeMatcher: "lookup"}).format(3)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"})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"})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"})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"})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"})arqam("150", {approx: "about"})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"})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})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: ريال قطري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(" | ")قرابة: منصوب وعلامة نصبه الفتحة الظاهرة، وهو مضاف | ألف: مضاف إليه مجرور بالكسرة الظاهرة، وهو مضاف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("قرابة ألف ريال قطري")JSON.stringify(arqam.findNumbers("بضعة آلاف ريال").map(x => [x.approx, x.min, x.max]))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"})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"})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"})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"})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"})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"})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"})(arqam.registerTimeZone("America/Denver", "دنفر"), arqam.toTime("2026-11-24T06:15:00Z", {timeZone: "America/Denver"}))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"})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"})arqam("1500.5", {locale: "ar-KW", style: "currency", brackets: "end"})arqam("1500.5", {locale: "ar-MA", style: "currency", brackets: "end"})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"})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(" ")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.
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"})arqam("1234.56")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();#Q574Q575Why 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")arqam("1234.56", {currency: "QAR"})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"})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"})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("ريالان قطريان")arqam.fromWords("مائة ريال قطري ودرهمان")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))No question matches. Try a shorter word, or the names in English (tashkeel, Hijri, cheque) or in Arabic (تفقيط، هجري).