↑ Top
GitHubArqam

Manual: English (arqamEN)

Manual: English (arqamEN)

arqamEN, the English engine of Arqam: numbers and amounts in English words. It is reached through the library by an English locale; for both languages at once and for documents, see the library's manual.

1. Quick start

arqamEN writes numbers and amounts in English words, through the library: load arqam/en and give an English locale (see the library's manual). Two ways to call it: NumberFormat, the shape and the option names of JavaScript's own Intl.NumberFormat (chapter 2), and toWords(), with every option of the engine (chapters 3 and after).

import arqam from "arqam";
import "arqam/en";                         // English, by its locale
new arqam.NumberFormat("en-GB", {currency: "QAR"}).format(1250.5);
                                           // One Thousand Two Hundred and Fifty Qatari Riyals and Fifty Dirhams
arqam("1250.50", "en-US", {currency: "QAR"});
                                           // One Thousand Two Hundred Fifty Qatari Riyals and Fifty Dirhams
new arqam.NumberFormat("en-GB", {currency: "QAR"}).format("1250.5")
→One Thousand Two Hundred and Fifty Qatari Riyals and Fifty Dirhams
new arqam.NumberFormat("en-US", {currency: "USD", brackets: "end", only: "end"}).format("99.5")
→Ninety-Nine US Dollars and Fifty Cents Only (USD 99.50)
arqam("2026", "en-US")
→Two Thousand Twenty-Six
arqam("1250.50", "en-US", {currency: "QAR"})
→One Thousand Two Hundred Fifty Qatari Riyals and Fifty Dirhams
arqam("21", "en-US", {style: "ordinal"})
→"Twenty-First"

2. NumberFormat: as Intl

arqam.NumberFormat(locales, options) with an English locale has the shape, the option names and the methods of JavaScript's Intl.NumberFormat, but it writes words; arqamAR.NumberFormat does the same for Arabic. Whoever knows Intl can use it at once. It is built on toWords(), so its words are toWords' words.

The locale decides the English

«en» alone and the American locales (en-US …) write no «and»: «One Hundred Twenty-One». Every other English locale (en-GB, en-AU, en-IN, en-ZA …) writes it: «One Hundred and Twenty-One». en-IN, en-PK, en-BD and en-NP count in lakh and crore. The figure in brackets is written as the locale writes figures: 1,250.50, 1,23,456.50 in en-IN, 1 250,50 in en-ZA. variant ("us", "uk") and scale ("indian", "short") choose otherwise.

new arqam.NumberFormat("en-US", {currency: "QAR", brackets: "end"}).format("1250.5")
→One Thousand Two Hundred Fifty Qatari Riyals and Fifty Dirhams (QAR 1,250.50)
US: no «and»
new arqam.NumberFormat("en-GB", {currency: "QAR", brackets: "end"}).format("1250.5")
→One Thousand Two Hundred and Fifty Qatari Riyals and Fifty Dirhams (QAR 1,250.50)
UK: «and»
new arqam.NumberFormat("en-IN", {currency: "INR", brackets: "end", only: "end"}).format("123456.5")
→One Lakh Twenty-Three Thousand Four Hundred and Fifty-Six Indian Rupees and Fifty Paise Only (INR 1,23,456.50)
lakh, and Indian grouping in the figure
new arqam.NumberFormat("en-IN", {currency: "INR", scale: "short"}).format("123456")
→One Hundred and Twenty-Three Thousand Four Hundred and Fifty-Six Indian Rupees
thousands instead
new arqam.NumberFormat("en-ZA", {currency: "ZAR", brackets: "start"}).format("1250.5")
→(ZAR 1 250,50) One Thousand Two Hundred and Fifty South African Rand and Fifty Cents
the locale's separators
new arqam.NumberFormat("en-GB", {variant: "us"}).format("121")
→One Hundred Twenty-One
variant: US style in a UK locale

The options

Intl's names, with Intl's meaning:

OptionValuesWhat it does
style"decimal" (default) · "currency" · "percent" · "ordinal"a number, an amount, a percentage (the number times 100, as Intl: 0.125 is Twelve point Five Percent), an ordinal (Arqam's own)
currencyan ISO codethe currency; required with style currency
currencyDisplay"code" (default) · "symbol" · "narrowSymbol" · "name" · "native"the label of the figure in brackets: QAR, QR or $, Qatari Riyal, ر.ق.
maximumFractionDigits0–100round to so many places first (half up, unless roundingMode is trunc)
roundingMode"trunc" (default) · "halfExpand"cut the places beyond the currency's, as a cheque, or round them
signDisplay"auto" (default) · "negative" · "never"«Negative» before a negative number, or no sign (in the figure too)
numberingSystem"latn"the only one

Arqam's own: variant and scale (above), and every option of toWords() (chapter 4) but style, whose name is Intl's here: brackets, only, textFormat (also "upper", "lower", "sentence"), noCountry, comma, compact, decFormat … When an Intl name and an Arqam name are both given, Arqam's wins (code over currency, symbol over currencyDisplay). An option name it does not know is a TypeError, with the nearest name; Intl's options for figures (useGrouping, notation …) are a RangeError.

new arqam.NumberFormat("en-GB", {currency: "QAR", brackets: "end", only: "end"}).format("1250.5")
→One Thousand Two Hundred and Fifty Qatari Riyals and Fifty Dirhams Only (QAR 1,250.50)
a cheque
new arqam.NumberFormat("en-GB", {currency: "USD", brackets: "end", only: "end", textFormat: "upper"}).format("99.5")
→NINETY-NINE US DOLLARS AND FIFTY CENTS ONLY (USD 99.50)
a cheque in capitals
new arqam.NumberFormat("en-GB", {currency: "EUR", brackets: "end", currencyDisplay: "symbol"}).format("1250.5")
→One Thousand Two Hundred and Fifty Euros and Fifty Cents (€ 1,250.50)
the symbol in the figure
new arqam.NumberFormat("en-GB", {currency: "QAR", roundingMode: "halfExpand", brackets: "end"}).format("3.456")
→Three Qatari Riyals and Forty-Six Dirhams (QAR 3.46)
rounded
new arqam.NumberFormat("en-GB", {maximumFractionDigits: 1}).format("3.456")
→Three point Five
a number, one place
new arqam.NumberFormat("en-GB", {currency: "USD", signDisplay: "never", brackets: "end"}).format("-75")
→Seventy-Five US Dollars (USD 75.00)
no sign
new arqam.NumberFormat("en-GB", {style: "percent", brackets: "end"}).format("0.125")
→Thirteen Percent (13%)
a percentage
new arqam.NumberFormat("en-GB", {style: "ordinal"}).format("121")
→One Hundred and Twenty-First
an ordinal
new arqam.NumberFormat("en-GB", {brackts: "end"}).format("5")
→TypeError: arqam.NumberFormat: unknown option "brackts"; did you mean "brackets"?
a misspelt option

The methods

As Intl's, and bound, so list.map(nf.format) works; the formatter is frozen.

MethodWhat it gives
format(x)the words; a list gives a list
formatToParts(x)the words in typed parts, with Intl's type names where Intl has one (integer, decimal, fraction, currency, minusSign, percentSign, literal) and Arqam's own: minorCurrency, denominator, ordinal, prefix and suffix («Only»), figure (with its own parts, as Intl cuts figures). The values joined give format(x).
formatRange(a, b)«From A to B», with «Only» and the figure once; equal values give one value; a start after the end is a RangeError
formatRangeToParts(a, b)the parts of formatRange, each with its source: startRange, endRange or shared
resolvedOptions()the locale and the options in force
NumberFormat.supportedLocalesOf(list)the English locales of the list
new arqam.NumberFormat("en-GB", {currency: "QAR", brackets: "end"}).formatToParts("1250.5")
→[{"type":"integer","value":"One Thousand"},{"type":"literal","value":" "},{"type":"integer","value":"Two Hundred and Fifty"},{"type":"literal","value":" "},{"type":"currency","value":"Qatari Riyals"},{"type":"literal","value":" and "},{"type":"fraction","value":"Fifty"},{"type":"literal","value":" "},{"type":"minorCurrency","value":"Dirhams"},{"type":"literal","value":" "},{"type":"figure","value":"(QAR 1,250.50)","parts":[{"type":"literal","value":"("},{"type":"currency","value":"QAR"},{"type":"literal","value":" "},{"type":"integer","value":"1"},{"type":"group","value":","},{"type":"integer","value":"250"},{"type":"decimal","value":"."},{"type":"fraction","value":"50"},{"type":"literal","value":")"}]}]
new arqam.NumberFormat("en-GB", {currency: "QAR", brackets: "end", only: "end"}).formatRange(1000, 2000)
→From One Thousand Qatari Riyals to Two Thousand Qatari Riyals Only (QAR 1,000.00–2,000.00)
a range
new arqam.NumberFormat("en-IN", {currency: "INR", brackets: "start"}).formatRange(100000, 250000)
→(INR 1,00,000.00–2,50,000.00) From One Lakh Indian Rupees to Two Lakh Fifty Thousand Indian Rupees
new arqam.NumberFormat("en-IN", {currency: "INR"}).resolvedOptions()
→{"locale":"en-IN","numberingSystem":"latn","style":"currency","currency":"INR","currencyDisplay":"code","roundingMode":"halfExpand","signDisplay":"auto","variant":"uk","scale":"indian"}
arqam.NumberFormat.supportedLocalesOf(["en-GB", "ar-QA", "en-in"])
→en-GBar-QAen-IN

3. Numbers and amounts

An amount is style: "currency" with its currency, as in Intl; a currency alone (in the call or set with config()) makes an amount too. The options of a call apply to that call only. Before, the second parameter was the options or a code (mode: "currency", config()): mode is still taken; the second parameter is now the locale.

arqam("12.5", "en-US", {currency: "KWD"})
→Twelve Kuwaiti Dinars and Five Hundred Fils
arqam("12.5", "en-US", {mode: "currency", currency: "KWD"})
→Twelve Kuwaiti Dinars and Five Hundred Fils
arqam("12.5", "en-US", {currency: "KWD"})
→Twelve Kuwaiti Dinars and Five Hundred Fils

4. Every option

Each option: what it does and why, its values, what else to know, examples of different uses, and the options it works with. They go in the options of arqam(n, locale, options) and new arqam.NumberFormat(locale, options), beside Intl's.

mode

Every option › mode

Format

arqam(number, "en", {mode: value})
new arqam.NumberFormat("en", {mode: value}).format(number)
arqamEN.config({mode: value})
ValuesDefault
"" | "currency" | "ordinals"""

Description

Says what the number is: a plain number, an amount of money, or a position in a list (an ordinal). The same digits are written differently in each: 12.5 is «Twelve point Five» as a number and «Twelve Qatari Riyals and Fifty Dirhams» as an amount.

Values

ValueMeaning
""a number (the default)
"currency"an amount; "c" is the short form
"ordinals"an ordinal, First, Twenty-First; "o" is the short form

The shortcut

A currency code given as text, toWords(n, "QAR"), is the same as {mode: "currency", currency: "QAR"}. An options object needs the mode: with only a code the number is still written as a number.

Ordinals

Only the whole number is used: 12.5 gives «Twelfth».

Examples

arqam("12.5", "en-US")
→Twelve point Five
a number
arqam("12.5", "en-US", {mode: "currency", currency: "QAR"})
→Twelve Qatari Riyals and Fifty Dirhams
an amount
arqam("12.5", "en-US", {currency: "QAR"})
→Twelve Qatari Riyals and Fifty Dirhams
a code: style currency
arqam("12.5", "en-US", {currency: "QAR"})
→Twelve Qatari Riyals and Fifty Dirhams
a currency without the style: a TypeError, as Arqam does not write a plain number in silence
arqam("21", "en-US", {mode: "o"})
→"Twenty-First"
an ordinal
arqam("121", "en-GB", {mode: "o"})
→One Hundred and Twenty-First
an ordinal in UK style

Works with

code (the currency of an amount), style (also for ordinals).

Errors

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

arqam("5", "en-US", {mode: "x"})
→TypeError: arqam.toWords: mode must be one of "", "currency", "c", "ordinals", "o", "numbers", "n" (got "x")

currency

Every option › currency

Format

arqam(number, "en", {currency: value})
new arqam.NumberFormat("en", {currency: value}).format(number)
arqamEN.config({currency: value})
ValuesDefault
"QAR" | """QAR"

Description

The currency of an amount, by its ISO 4217 code, with style: "currency" (Intl's names). It gives the currency's names (with its country's adjective), the names of its minor unit, its number of decimal places and its symbols.

Values

ValueMeaning
"QAR"any of the 188 codes of Arqam's table, in any letter case
""none (the default)

Places

The amount is counted in the currency's places: two for the riyal, three for the Kuwaiti dinar, none for the yen. Digits beyond them are rounded half up, as Intl (roundingMode: "trunc" cuts them).

The name

currency is Intl's name; code is not an option (a TypeError that says so).

An unknown code

It is an error that says how to add it: registerCurrency(), or the names given in the call (see demonym, major, minor…). With a code, names given in the call are not used.

Examples

arqam("12.5", "en-US", {currency: "qar"})
→Twelve Qatari Riyals and Fifty Dirhams
any letter case
arqam("12.5", "en-US", {mode: "currency", currency: "QAR"})
→Twelve Qatari Riyals and Fifty Dirhams
with mode, the engine's name for the style
arqam("3.4567", "en-US", {currency: "KWD"})
→Three Kuwaiti Dinars and Four Hundred Fifty-Seven Fils
three decimal places
arqam("1250.5", "en-US", {currency: "JPY"})
→One Thousand Two Hundred Fifty-One Japanese Yen
no decimal places
arqam("1", "en-US", {currency: "QAR"})
→One Qatari Riyal
one: the singular
arqam("12.5", "en-US", {currency: "XYZ"})
→TypeError: arqam.toWords: unknown currency code "XYZ": add it with registerCurrency(), or give major and majorPl in the same call
an unknown code

Works with

mode, noCountry, brackets and symbol, rounding.

Errors

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

arqam("5", "en-US", {currency: "x"})
→RangeError: arqam.toWords: invalid currency "x"

style

Every option › style

Format

arqam(number, "en", {style: value})
new arqam.NumberFormat("en", {style: value}).format(number)
arqamEN.config({style: value})
ValuesDefault
"" | "uk"""

Description

American or British English, given by the locale: en-GB (UK) or en-US (US); variant: "uk" or "us" gives it with any locale. (style is Intl's: decimal, currency, percent, ordinal.) British English writes «and» before the tens and units: «One Hundred and One»; American English leaves it out. The «and» comes only before the last part when it is under one hundred, so «Fifteen Thousand Four Hundred» has none.

Values

ValueMeaning
""US style (the default): no «and»
"uk"UK style

Examples

arqam("101", "en-GB")
→One Hundred and One
arqam("1250", "en-GB")
→One Thousand Two Hundred and Fifty
arqam("15400", "en-GB")
→Fifteen Thousand Four Hundred
nothing under one hundred at the end: no «and»
arqam("1000001", "en-GB")
→One Million and One
arqam("2.5", "en-GB", {mode: "currency", currency: "GBP"})
→Two Pounds Sterling and Fifty Pence
an amount
arqam("121", "en-GB", {mode: "o"})
→One Hundred and Twenty-First
an ordinal

Works with

comma (a comma between the groups, the usual British cheque form), mode.

only

Every option › only

Format

arqam(number, "en", {only: value})
new arqam.NumberFormat("en", {only: value}).format(number)
arqamEN.config({only: value})
ValuesDefault
"" | "end" | "start"""

Description

Adds «Only», as on cheques and payment orders, so that nothing can be written after (or before) the amount.

Values

ValueMeaning
""none (the default)
"end"after the words: the usual form
"start"before the words

With brackets

«Only» comes before the figure in brackets.

Examples

arqam("99.5", "en-US", {mode: "currency", currency: "USD", only: "end"})
→Ninety-Nine US Dollars and Fifty Cents Only
arqam("99.5", "en-US", {mode: "currency", currency: "USD", only: "start"})
→Only Ninety-Nine US Dollars and Fifty Cents
arqam("99.5", "en-US", {mode: "currency", currency: "USD", only: "end", brackets: "end"})
→Ninety-Nine US Dollars and Fifty Cents Only (USD 99.50)
as on a cheque: «Only», then the figure
arqam("99.5", "en-US", {mode: "currency", currency: "USD", only: "end", textFormat: "U"})
→NINETY-NINE US DOLLARS AND FIFTY CENTS ONLY
in capitals
arqam("99", "en-US", {only: "end"})
→Ninety-Nine Only
a number

Works with

brackets, textFormat, style.

Errors

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

arqam("5", "en-US", {only: "x"})
→TypeError: arqam.toWords: only must be one of "", "start", "end" (got "x")

comma

Every option › comma

Format

arqam(number, "en", {comma: value})
new arqam.NumberFormat("en", {comma: value}).format(number)
arqamEN.config({comma: value})
ValuesDefault
"" | "on"""

Description

Puts a comma between the groups of a long number (millions, thousands …), which makes it easier to read aloud and is common on British cheques.

Values

ValueMeaning
""no commas (the default)
"on"a comma after each group

Where

A comma comes before each group of one hundred or more; before a last group under one hundred there is none: «Five Million One».

Examples

arqam("12123101", "en-US", {comma: "on"})
→Twelve Million, One Hundred Twenty-Three Thousand, One Hundred One
arqam("12123001", "en-US", {comma: "on"})
→Twelve Million, One Hundred Twenty-Three Thousand One
no comma before «One»
arqam("1250", "en-GB", {comma: "on"})
→One Thousand, Two Hundred and Fifty
UK style
arqam("12123001.5", "en-US", {mode: "currency", currency: "QAR", comma: "on"})
→Twelve Million, One Hundred Twenty-Three Thousand One Qatari Riyals and Fifty Dirhams
an amount

Works with

style, compact.

Errors

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

arqam("5", "en-US", {comma: "x"})
→TypeError: arqam.toWords: comma must be one of "", "on", "off" (got "x")

compact

Every option › compact

Format

arqam(number, "en", {compact: value})
new arqam.NumberFormat("en", {compact: value}).format(number)
arqamEN.config({compact: value})
ValuesDefault
"" | "on"""

Description

Writes each group as figures with its scale word: «12 Million 123 Thousand 1». Shorter than full words for very large numbers, for reports and screens where a cheque's full words are not needed.

Values

ValueMeaning
""full words (the default)
"on"the groups as figures

Examples

arqam("12123001", "en-US", {compact: "on"})
→12 Million 123 Thousand 1
arqam("2500000", "en-US", {mode: "currency", currency: "USD", compact: "on"})
→2 Million 500 Thousand US Dollars
an amount
arqam("1250000.75", "en-US", {compact: "on"})
→1 Million 250 Thousand point Seven Five
the decimal part is still in words

Works with

comma, decFormat (the fraction in figures too).

Errors

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

arqam("5", "en-US", {compact: "x"})
→TypeError: arqam.toWords: compact must be one of "", "on", "off" (got "x")

brackets

Every option › brackets

Format

arqam(number, "en", {brackets: value})
new arqam.NumberFormat("en", {brackets: value}).format(number)
arqamEN.config({brackets: value})
ValuesDefault
"" | "end" | "start"""

Description

Writes the amount in figures, in brackets, beside the words: before them or after them. This is how a cheque, an invoice or a contract writes an amount: the words in full and the figure beside them, so a reader can check one against the other.

Values

ValueMeaning
""none (the default): the words only
"end"after the words, and after «Only» when only is given: the usual form on cheques and invoices
"start"before the words: a heading or a list of amounts

What is in the brackets

The label (the currency's ISO code by default; see symbol), then the amount with a thousands separator and all the currency's decimal places: 1250.5 is written 1,250.50 in riyals, 1,250.500 in dinars, 1,250 in yen. A negative amount keeps its sign. A number without a currency has no label; ordinals have no figure.

Examples

arqam("1250.5", "en-US", {mode: "currency", currency: "QAR", brackets: "end"})
→One Thousand Two Hundred Fifty Qatari Riyals and Fifty Dirhams (QAR 1,250.50)
after the words
arqam("1250.5", "en-US", {mode: "currency", currency: "QAR", brackets: "start"})
→(QAR 1,250.50) One Thousand Two Hundred Fifty Qatari Riyals and Fifty Dirhams
before the words
arqam("1250.5", "en-US", {mode: "currency", currency: "QAR", brackets: "end", only: "end"})
→One Thousand Two Hundred Fifty Qatari Riyals and Fifty Dirhams Only (QAR 1,250.50)
as on a cheque
arqam("1250.5", "en-GB", {mode: "currency", currency: "KWD", brackets: "end"})
→One Thousand Two Hundred and Fifty Kuwaiti Dinars and Five Hundred Fils (KWD 1,250.500)
three decimal places; UK style
arqam("1250.5", "en-US", {mode: "currency", currency: "JPY", brackets: "end"})
→One Thousand Two Hundred Fifty-One Japanese Yen (JPY 1,251)
no decimal places
arqam("-75", "en-US", {mode: "currency", currency: "USD", brackets: "end"})
→Negative Seventy-Five US Dollars (USD -75.00)
a negative amount
arqam("1250.5", "en-US", {mode: "currency", currency: "QAR", brackets: "end", symbol: "l"})
→One Thousand Two Hundred Fifty Qatari Riyals and Fifty Dirhams (QR 1,250.50)
the Latin symbol
arqam("1250.5", "en-US", { mode: "currency", currency: "EUR", brackets: "end", sepThousands: ".", sepDecimal: "," })
→One Thousand Two Hundred Fifty Euros and Fifty Cents (EUR 1,250.50)
European separators
arqam("1250.5", "en-US", {brackets: "end"})
→One Thousand Two Hundred Fifty point Five (1,250.5)
a number: no label
arqam("21", "en-US", {mode: "o", brackets: "end"})
→"Twenty-First"
an ordinal: no figure

Works with

symbol (the label), only, sepThousands and sepDecimal, textFormat (the words only; the figure is unchanged).

symbol

Every option › symbol

Format

arqam(number, "en", {symbol: value})
new arqam.NumberFormat("en", {symbol: value}).format(number)
arqamEN.config({symbol: value})
ValuesDefault
"" | "i" | "l" | "n" | "c"""

Description

The label in the brackets: how the currency is shown beside the figure. Only used with brackets.

Values

ValueMeaning
""the ISO code (the default); with noCountry, the plural name
"i"the ISO code
"l"the Latin symbol (QR, $, €), else the native one
"n"the native symbol (ر.ق., €)
"c"the country's adjective and the currency's name
any other textused as given

Examples

arqam("5", "en-US", {mode: "currency", currency: "QAR", brackets: "end", symbol: "i"})
→Five Qatari Riyals (QAR 5.00)
arqam("5", "en-US", {mode: "currency", currency: "QAR", brackets: "end", symbol: "l"})
→Five Qatari Riyals (QR 5.00)
arqam("5", "en-US", {mode: "currency", currency: "QAR", brackets: "end", symbol: "n"})
→Five Qatari Riyals (ر.ق. 5.00)
arqam("5", "en-US", {mode: "currency", currency: "QAR", brackets: "end", symbol: "c"})
→Five Qatari Riyals (Qatari Riyal 5.00)
arqam("5", "en-US", {mode: "currency", currency: "USD", brackets: "end", symbol: "US$"})
→Five US Dollars (US$ 5.00)
your own label
arqam("5", "en-US", {mode: "currency", currency: "QAR", symbol: "l"})
→Five Qatari Riyals
without brackets: no effect

Works with

brackets, noCountry.

currencyPos

Every option › currencyPos

Format

arqam(number, "en", {currencyPos: value})
new arqam.NumberFormat("en", {currencyPos: value}).format(number)
arqamEN.config({currencyPos: value})
ValuesDefault
"end" | "start""end"

Description

Puts the currency's name before the number instead of after it, for the forms that write «Qatari Riyals Five».

Values

ValueMeaning
"end"after the number (the default; "" is the same)
"start"before it

The minor unit

Only the major name moves; the minor unit stays after its number.

Examples

arqam("5", "en-US", {mode: "currency", currency: "QAR", currencyPos: "start"})
→Qatari Riyals Five
arqam("5.25", "en-US", {mode: "currency", currency: "QAR", currencyPos: "start"})
→Qatari Riyals Five and Twenty-Five Dirhams
the minor unit stays after its number
arqam("5", "en-US", {mode: "currency", currency: "QAR", currencyPos: "start", brackets: "end"})
→Qatari Riyals Five (QAR 5.00)
with the figure

Works with

brackets, noCountry.

Errors

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

arqam("5", "en-US", {currencyPos: "x"})
→TypeError: arqam.toWords: currencyPos must be one of "", "start", "end" (got "x")

noCountry

Every option › noCountry

Format

arqam(number, "en", {noCountry: value})
new arqam.NumberFormat("en", {noCountry: value}).format(number)
arqamEN.config({noCountry: value})
ValuesDefault
"" | "on"""

Description

Leaves out the country's adjective: «Twenty Dollars» instead of «Twenty US Dollars», for a document that already says which currency it uses.

Values

ValueMeaning
""with the adjective (the default)
"on"without it

In the brackets

Without a symbol, the label is then the plural name.

Examples

arqam("20", "en-US", {mode: "currency", currency: "USD", noCountry: "on"})
→Twenty Dollars
arqam("1", "en-US", {mode: "currency", currency: "KWD", noCountry: "on"})
→One Dinar
arqam("20.5", "en-US", {mode: "currency", currency: "GBP", noCountry: "on"})
→Twenty Pounds Sterling and Fifty Pence
a currency with no adjective is unchanged
arqam("20", "en-US", {mode: "currency", currency: "USD", noCountry: "on", brackets: "end"})
→Twenty Dollars (Dollars 20.00)
the label: the plural name
arqam("20", "en-US", { mode: "currency", currency: "USD", noCountry: "on", brackets: "end", symbol: "i" })
→Twenty Dollars (USD 20.00)
the ISO code asked for

Works with

brackets and symbol, currencyPos.

Errors

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

arqam("5", "en-US", {noCountry: "x"})
→TypeError: arqam.toWords: noCountry must be one of "", "on", "off" (got "x")

textFormat

Every option › textFormat

Format

arqam(number, "en", {textFormat: value})
new arqam.NumberFormat("en", {textFormat: value}).format(number)
arqamEN.config({textFormat: value})
ValuesDefault
"" | "U" | "L" | "S"""

Description

The letter case of the words: title case (each word with a capital, the default), capitals (as cheques are often printed), lower case, or a sentence.

Values

ValueMeaning
""Title Case (the default)
"U"UPPER CASE
"L"lower case
"S"Sentence case: a capital for the first word only

Currency names

In lower and sentence case the currency's names keep their capitals: they are names.

Examples

arqam("1234", "en-US", {textFormat: "U"})
→ONE THOUSAND TWO HUNDRED THIRTY-FOUR
arqam("1234", "en-US", {textFormat: "L"})
→one thousand two hundred thirty-four
arqam("1234", "en-US", {textFormat: "S"})
→One thousand two hundred thirty-four
arqam("1250.5", "en-US", {mode: "currency", currency: "QAR", textFormat: "L"})
→one thousand two hundred fifty Qatari Riyals and fifty Dirhams
the currency names keep their capitals
arqam("1250.5", "en-US", {mode: "currency", currency: "QAR", textFormat: "S"})
→One thousand two hundred fifty Qatari Riyals and fifty Dirhams
arqam("99.5", "en-US", { mode: "currency", currency: "USD", textFormat: "U", only: "end", brackets: "end" })
→NINETY-NINE US DOLLARS AND FIFTY CENTS ONLY (USD 99.50)
a cheque in capitals; the figure is unchanged

Works with

only, brackets.

Errors

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

arqam("5", "en-US", {textFormat: "x"})
→TypeError: arqam.toWords: textFormat must be one of "", "U", "L", "S" (got "x")

demonym, major, minor, majorPl, minorPl

Every option › demonym, major, minor, majorPl, minorPl

Format

arqam(number, "en", {demonym: …, major: …, minor: …, majorPl: …, minorPl: …})

Description

A currency named in the call, with no currency: its country's adjective, its name and its minor unit's name, and their plurals. For a currency used once; to use one again and again, add it with registerCurrency().

Values

ValueMeaning
demonymthe country's adjective (Mabatowan)
major, majorPlthe name and its plural
minor, minorPlthe minor unit's name and its plural

Plurals

A name given without its plural keeps one form. The minor unit has two decimal places unless decRound says otherwise. With a code, these names are not used.

Examples

arqam("5.25", "en-US", { mode: "currency", demonym: "Mabatowan", major: "Koko", majorPl: "Kokos", minor: "Kaka", minorPl: "Kakas" })
→Five Mabatowan Kokos and Twenty-Five Kakas
arqam("5.25", "en-US", {mode: "currency", demonym: "Mabatowan", major: "Koko", minor: "Kaka"})
→Five Mabatowan Koko and Twenty-Five Kaka
no plurals given: one form
arqam("1.01", "en-US", { mode: "currency", major: "Token", majorPl: "Tokens", minor: "Cent", minorPl: "Cents" })
→One Token and One Cent
without an adjective
arqam("3.25", "en-US", { mode: "currency", major: "Unit", majorPl: "Units", minor: "Sub", minorPl: "Subs", decRound: 3 })
→Three Units and Two Hundred Fifty Subs
three decimal places

Works with

decRound, brackets (the label is the plural name).

decRound

Every option › decRound

Format

arqam(number, "en", {decRound: value})
new arqam.NumberFormat("en", {decRound: value}).format(number)
arqamEN.config({decRound: value})
ValuesDefault
""""

Description

The number of decimal places kept in a number, or in an amount of a currency named in the call. The places beyond are cut, or rounded with rounding.

Values

ValueMeaning
a whole numberthe places
""the default: 10 for numbers; a currency's own places for an amount

Amounts with a code

A currency with a code always keeps its own places: decRound does not change them.

Examples

arqam("3.456", "en-US", {decRound: 1})
→Three point Four
arqam("3.456", "en-US", {decRound: 0})
→"Three"
the whole number only
arqam("3.456", "en-US", {decRound: 1, rounding: "on"})
→Three point Five
rounded
arqam("2.1234567891234", "en-US")
→Two point One Two Three
the default: ten places
arqam("3.456", "en-US", {mode: "currency", currency: "QAR", decRound: 3})
→Three Qatari Riyals and Forty-Six Dirhams
a code keeps its two places

Works with

rounding, decFormat.

Errors

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

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

rounding

Every option › rounding

Format

arqam(number, "en", {rounding: value})
new arqam.NumberFormat("en", {rounding: value}).format(number)
arqamEN.config({rounding: value})
ValuesDefault
"" | "on"""

Description

Rounds the extra decimal places (half up). As Intl, this is the default; roundingMode: "trunc" cuts them instead, as a bank does when it writes a cheque from a longer figure.

Values

ValueMeaning
""Intl's roundingMode decides (default half up)
"on"round half up

Examples

arqam("3.456", "en-US", {currency: "QAR"})
→Three Qatari Riyals and Forty-Six Dirhams
rounded, the default
arqam("3.456", "en-US", {mode: "currency", currency: "QAR", roundingMode: "trunc"})
→Three Qatari Riyals and Forty-Five Dirhams
cut
arqam("3.456", "en-US", {mode: "currency", currency: "QAR", rounding: "on"})
→Three Qatari Riyals and Forty-Six Dirhams
rounded
arqam("3.455", "en-US", {mode: "currency", currency: "QAR", rounding: "on"})
→Three Qatari Riyals and Forty-Six Dirhams
half up
arqam("9.999", "en-US", {mode: "currency", currency: "QAR", rounding: "on"})
→Ten Qatari Riyals
into the next whole riyal
arqam("-3.456", "en-US", {mode: "currency", currency: "QAR", rounding: "on"})
→Negative Three Qatari Riyals and Forty-Six Dirhams
a negative amount
arqam("3.456", "en-US", {decRound: 1, rounding: "on"})
→Three point Five
a number

Works with

decRound, code.

Errors

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

arqam("5", "en-US", {rounding: "x"})
→TypeError: arqam.toWords: rounding must be one of "", "on", "off" (got "x")

decFormat

Every option › decFormat

Format

arqam(number, "en", {decFormat: value})
new arqam.NumberFormat("en", {decFormat: value}).format(number)
arqamEN.config({decFormat: value})
ValuesDefault
"" | "w" | "n" | "." | "/" | "th" | "tn" | "p" | "pn" | "nn"""

Description

How the decimal part is written: digit by digit after «point», as one number, in figures, or as a fraction. Numbers and amounts read it differently (see «Fractions» for every form).

Values

ValueMeaning
""numbers: point and each digit; amounts: the minor unit in words
"w"numbers: point and the decimal part as one number
"n"point (or the minor unit) with the decimal part in figures
"."and 0.25 (an amount: and 0.25 Qatari Riyals)
"/"and 25/100
"th"numbers: and Twenty-Five Hundredths
"tn"numbers: and 25 Hundredths
"p"numbers: and Twenty-Five parts of One Hundred
"pn"numbers: and 25 parts of One Hundred
"nn"numbers: and 25 parts of 100

Amounts

In an amount the forms that name the fraction (th, tn, p, pn, nn) write the minor unit: in words for th and p, in figures for tn, pn and nn.

Examples

arqam("3.25", "en-US", {decFormat: "w"})
→Three point Twenty-Five
arqam("3.25", "en-US", {decFormat: "n"})
→Three point 25
arqam("3.25", "en-US", {decFormat: "th"})
→Three and Twenty-Five Hundredths
arqam("3.25", "en-US", {decFormat: "/"})
→Three and 25/100
arqam("3.25", "en-US", {mode: "currency", currency: "QAR", decFormat: "n"})
→Three Qatari Riyals and 25 Dirhams
an amount: the minor unit in figures
arqam("3.25", "en-US", {mode: "currency", currency: "QAR", decFormat: "/"})
→Three and 25/100 Qatari Riyals
an amount as a fraction
arqam("3.25", "en-US", {mode: "currency", currency: "QAR", decFormat: "."})
→Three and 0.25 Qatari Riyals

Works with

decFormatC and decFormatN, decWord, decRound.

Errors

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

arqam("5", "en-US", {decFormat: "x"})
→TypeError: arqam.toWords: decFormat must be one of "", "w", "n", ".", "/", "th", "tn", "p", "pn", "nn" (got "x")

decFormatC, decFormatN

Every option › decFormatC, decFormatN

Format

arqam(number, "en", {decFormatC: …, decFormatN: …})

Description

decFormat for amounts only, or for numbers only. Useful as standing options (config()) when one program writes both: the minor unit in figures for amounts, the decimal part as one number for numbers.

Values

ValueMeaning
as decFormatdecFormatC for amounts, decFormatN for numbers; each wins over decFormat

Examples

arqam("3.25", "en-US", {mode: "currency", currency: "QAR", decFormatC: "n", decFormatN: "w"})
→Three Qatari Riyals and 25 Dirhams
an amount: decFormatC
arqam("3.25", "en-US", {decFormatC: "n", decFormatN: "w"})
→Three point Twenty-Five
a number: decFormatN
arqam("3.25", "en-US", {decFormat: "n", decFormatN: "th"})
→Three and Twenty-Five Hundredths
decFormatN wins over decFormat

Works with

decFormat.

decWord

Every option › decWord

Format

arqam(number, "en", {decWord: value})
new arqam.NumberFormat("en", {decWord: value}).format(number)
arqamEN.config({decWord: value})

Description

The word of the decimal point in numbers: «point» by default, or «dot», «decimal» or a word of your own.

Values

ValueMeaning
a worddefault "point"

Amounts

An amount writes its minor unit, so decWord is not used.

Examples

arqam("3.25", "en-US", {decWord: "dot"})
→Three dot Two Five
arqam("3.25", "en-US", {decFormat: "w", decWord: "Decimal"})
→Three Decimal Twenty-Five
with decFormat w
arqam("3.25", "en-US", {mode: "currency", currency: "QAR", decWord: "dot"})
→Three Qatari Riyals and Twenty-Five Dirhams
an amount: not used

Works with

decFormat, textFormat.

negativeWord

Every option › negativeWord

Format

arqam(number, "en", {negativeWord: value})
new arqam.NumberFormat("en", {negativeWord: value}).format(number)
arqamEN.config({negativeWord: value})

Description

The word before a negative number: «Negative» by default, or «Minus», «Less» or a word of your own, for statements and credit notes.

Values

ValueMeaning
a worddefault "Negative"

Examples

arqam("-5", "en-US", {negativeWord: "Minus"})
→Minus Five
arqam("-5.5", "en-US", {mode: "currency", currency: "USD", negativeWord: "Less"})
→Less Five US Dollars and Fifty Cents
an amount
arqam("-5", "en-US", {mode: "currency", currency: "USD", negativeWord: "Minus", brackets: "end"})
→Minus Five US Dollars (USD -5.00)
the figure keeps its sign

Works with

brackets, textFormat.

sepThousands, sepDecimal

Every option › sepThousands, sepDecimal

Format

arqam(number, "en", {sepThousands: …, sepDecimal: …})
ValuesDefault
""""

Description

The separators of the figure in brackets: the thousands separator and the decimal mark. The words do not change.

Values

ValueMeaning
a characterthe separator, e.g. ".", ",", " ", "'"
a localeits separator, e.g. "de-CH" for 1'234
""the computer's own (the default)

Examples

arqam("1234.5", "en-US", {brackets: "end", sepThousands: ".", sepDecimal: ","})
→One Thousand Two Hundred Thirty-Four point Five (1,234.5)
arqam("1234567.5", "en-US", { mode: "currency", currency: "EUR", brackets: "end", sepThousands: " ", sepDecimal: "," })
→One Million Two Hundred Thirty-Four Thousand Five Hundred Sixty-Seven Euros and Fifty Cents (EUR 1,234,567.50)
a space between the thousands
arqam("1234.5", "en-US", {mode: "currency", currency: "CHF", brackets: "end", sepThousands: "de-CH"})
→One Thousand Two Hundred Thirty-Four Swiss Francs and Fifty Centimes (CHF 1,234.50)
a locale

Works with

brackets.

isNaN

Every option › isNaN

Format

arqam(number, "en", {isNaN: value})
new arqam.NumberFormat("en", {isNaN: value}).format(number)
arqamEN.config({isNaN: value})

Description

What is given back for text that is not a number, instead of an error: an empty text by default, or a word of your own to show in a form or a report.

Values

ValueMeaning
textdefault ""

What is a number

Digits with an optional minus sign and one decimal point, as JavaScript writes them: «1234.56». A comma, a space or an exponent («1e5») makes it not a number.

Examples

arqam("12,5", "en-US", {isNaN: "?"})
→"?"
a comma
arqam("1e5", "en-US", {isNaN: "not a number"})
→not a number
an exponent
arqam(" 5", "en-US", {isNaN: "not a number"})
→not a number
a space
arqam("abc", "en-US")
→""
the default: empty

split

Every option › split

Format

arqam(number, "en", {split: value})
new arqam.NumberFormat("en", {split: value}).format(number)
arqamEN.config({split: value})
ValuesDefault
"" | "on"""

Description

Marks the parts of the words so a page can colour them: the punctuation, the currency's names, the fraction and the groups.

Values

ValueMeaning
""no marks (the default)
"on"|p punctuation, |c currency names, |f| where the fraction starts, | after each group

Showing them

A page turns the marks into colours; the Arabic manual's 12.15 Colours: split shows how, and the marks are the same. Text shown without that script should not have them.

Examples

arqam("12.5", "en-US", {mode: "currency", currency: "QAR", split: "on"})
→Twelve Qatari Riyals and Fifty Dirhams
arqam("1250", "en-US", {split: "on"})
→One Thousand Two Hundred Fifty
a number: the groups
arqam("-5", "en-US", {mode: "currency", currency: "QAR", split: "on", brackets: "end"})
→Negative Five Qatari Riyals (QAR -5.00)
with the figure

Works with

textFormat (the marks keep their letter case).

scale

Every option › scale

Format

arqam(number, "en", {scale: value})
new arqam.NumberFormat("en", {scale: value}).format(number)
arqamEN.config({scale: value})
ValuesDefault
"" | "indian"""

Description

How large numbers are counted: by thousand, million, billion, or by lakh (a hundred thousand) and crore (ten million), as in India, Pakistan, Bangladesh and Nepal, where cheques and contracts are written so. With NumberFormat the locale chooses it (en-IN, en-PK, en-BD, en-NP: lakh and crore).

Values

ValueMeaning
""thousand, million … (the default; "short" is the same)
"indian"lakh and crore

Large numbers

Crores are counted as numbers, so 10,000,000,000 is One Thousand Crore and 1012 One Lakh Crore.

Examples

arqam("123456", "en-US", {scale: "indian"})
→One Lakh Twenty-Three Thousand Four Hundred Fifty-Six
arqam("12345678", "en-US", {scale: "indian"})
→One Crore Twenty-Three Lakh Forty-Five Thousand Six Hundred Seventy-Eight
arqam("123456.5", "en-GB", {mode: "currency", currency: "INR", scale: "indian"})
→One Lakh Twenty-Three Thousand Four Hundred and Fifty-Six Indian Rupees and Fifty Paise
an amount, UK style
arqam("1000000000000", "en-US", {scale: "indian"})
→One Lakh Crore
a lakh crore
arqam("1234567", "en-US", {scale: "indian", compact: "on"})
→12 Lakh 34 Thousand 567
compact

Works with

style, comma, compact, mode (ordinals too).

5. UK and US style; «Only»

US style (the default) writes no "and" inside a number; UK style writes "and" before the tens and units of the last group only: "One Thousand Two Hundred and Fifty", "One Thousand and Five", but "Fifteen Thousand Four Hundred". The library's toBilingual() and toClause() use UK style.

arqam("1250", "en-GB")
→One Thousand Two Hundred and Fifty
arqam("1005", "en-GB")
→One Thousand and Five
arqam("15400", "en-GB")
→Fifteen Thousand Four Hundred
arqam("1250", "en-US")
→One Thousand Two Hundred Fifty
arqam("1250.5", "en-GB", {mode: "currency", currency: "SAR", only: "end", brackets: "end"})
→One Thousand Two Hundred and Fifty Saudi Riyals and Fifty Halalahs Only (SAR 1,250.50)
arqam("1250.5", "en-US", {mode: "currency", currency: "SAR", only: "start"})
→Only One Thousand Two Hundred Fifty Saudi Riyals and Fifty Halalahs

6. Fractions

In an amount the decimal part is the minor unit (dirhams, cents …), with the currency's places. In a number it is written by decFormat:

decFormatForm3.25
""point and the digitsThree point Two Five
"w"point and the decimal part as a numberThree point Twenty-Five
"n"point and the decimal part in figuresThree point 25
"."and 0.25Three and 0.25
"/"and 25/100Three and 25/100
"th"and twenty-five hundredthsThree and Twenty-Five Hundredths
"tn"and 25 hundredthsThree and 25 Hundredths
"p"and twenty-five parts of one hundredThree and Twenty-Five parts of One Hundred
"pn"and 25 parts of 100Three and 25 parts of One Hundred
"nn"the parts in figuresThree and 25 parts of 100

7. The currencies

The 188 currencies of Arqam's table, with the same codes and decimals as the Arabic engine: one, two, and the smallest amount of the minor unit.

CodeOneTwoThe minor unit
ABKHAZIAOne Abkhazian ApsarTwo Abkhazian ApsarkZero Abkhazian Apsar
ADAOne CardanoTwo Cardano0.01
AEDOne UAE DirhamTwo UAE DirhamsOne Fils
AFNOne Afghan AfghaniTwo Afghan AfghaniOne Pul
ALLOne Albanian LekTwo Albanian LekëOne Qindarka
AMDOne Armenian DramTwo Armenian DramOne Luma
ANGOne Netherlands Antillean GuilderTwo Netherlands Antillean GuildersOne Cent
AOAOne Angolan KwanzaTwo Angolan KwanzasOne Centimo
ARSOne Argentine PesoTwo Argentine PesosOne Centavo
ARTSAKHOne Artsakh DramTwo Artsakh DramOne Luma
AUDOne Australian DollarTwo Australian DollarsOne Cent
AWGOne Aruban FlorinTwo Aruban FlorinOne Cent
AZNOne Azerbaijani ManatTwo Azerbaijani ManatOne Qapik
BAMOne Bosnia-Herzegovina Convertible MarkTwo Bosnia-Herzegovina Convertible MarksOne Fening
BBDOne Barbadian DollarTwo Barbadian DollarsOne Cent
BCHOne Bitcoin CashTwo Bitcoin Cash0.01
BDTOne Bangladeshi TakaTwo Bangladeshi TakaOne Poisha
BGNOne Bulgarian LevTwo Bulgarian LevaOne Stotinka
BHDOne Bahraini DinarTwo Bahraini DinarsTen Fils
BIFOne Burundian FrancTwo Burundian FrancsZero Burundian Franc
BMDOne Bermudian DollarTwo Bermudian DollarsOne Cent
BNBOne Binance CoinTwo Binance Coins0.01
BNDOne Brunei DollarTwo Brunei DollarsOne Cent
BOBOne Bolivian BolivianoTwo Bolivian BolivianosOne Centavo
BRLOne Brazilian RealTwo Brazilian ReaisOne Centavo
BSDOne Bahamian DollarTwo Bahamian DollarsOne Cent
BTCOne BitcoinTwo Bitcoins0.01
BTNOne Bhutanese NgultrumTwo Bhutanese NgultrumsOne Chetrum
BWPOne Botswana PulaTwo Botswana PulaOne Thebe
BYNOne Belarusian RubleTwo Belarusian RublesOne Kapiejka
BZDOne Belize DollarTwo Belize DollarsOne Cent
CADOne Canadian DollarTwo Canadian DollarsOne Cent
CDFOne Congolese FrancTwo Congolese FrancsOne Centime
CHFOne Swiss FrancTwo Swiss FrancsOne Centime
CKDOne Cook Islands DollarTwo Cook Islands DollarsOne Cent
CLPOne Chilean PesoTwo Chilean PesosZero Chilean Peso
CNYOne Chinese YuanTwo Chinese YuanOne Fen
COPOne Colombian PesoTwo Colombian PesosOne Centavo
CRCOne Costa Rican ColónTwo Costa Rican ColonesOne Centimo
CUCOne Cuban Convertible PesoTwo Cuban Convertible PesosOne Centavo
CUPOne Cuban PesoTwo Cuban PesosOne Centavo
CVEOne Cabo Verdean EscudoTwo Cabo Verdean EscudosOne Centavo
CZKOne Czech KorunaTwo Czech KorunasOne Haléř
DASHOne DashTwo Dash0.01
DJFOne Djiboutian FrancTwo Djiboutian FrancsZero Djiboutian Franc
DKKOne Danish KroneTwo Danish KronerOne Øre
DOGEOne DogecoinTwo Dogecoins0.01
DOPOne Dominican PesoTwo Dominican PesosOne Centavo
DOTOne PolkadotTwo Polkadot0.01
DZDOne Algerian DinarTwo Algerian DinarsOne Santeem
EGPOne Egyptian PoundTwo Egyptian PoundsOne Qirsh
EHPOne Sahrawi PesetaTwo Sahrawi PesetasOne Centimo
ERNOne Eritrean NakfaTwo Eritrean NakfaOne Cent
ETBOne Ethiopian BirrTwo Ethiopian BirrOne Santim
ETHOne EtherTwo Ether0.01
EUROne EuroTwo EurosOne Cent
FJDOne Fijian DollarTwo Fijian DollarsOne Cent
FKPOne Falkland Islands PoundTwo Falkland Islands PoundsOne Penny
FOKOne Faroese KrónaTwo Faroese KrónasOne Oyra
GBPOne Pound SterlingTwo Pounds SterlingOne Penny
GELOne Georgian LariTwo Georgian LariOne Tetri
GGPOne Guernsey PoundTwo Guernsey PoundsOne Penny
GHSOne Ghanaian CediTwo Ghanaian CedisOne Pesewa
GIPOne Gibraltar PoundTwo Gibraltar PoundsOne Penny
GMDOne Gambian DalasiTwo Gambian DalasisOne Butut
GNFOne Guinean FrancTwo Guinean FrancsZero Guinean Franc
GTQOne Guatemalan QuetzalTwo Guatemalan QuetzalesOne Centavo
GYDOne Guyanese DollarTwo Guyanese DollarsOne Cent
HKDOne Hong Kong DollarTwo Hong Kong DollarsOne Cent
HNLOne Honduran LempiraTwo Honduran LempirasOne Centavo
HRKOne Croatian KunaTwo Croatian KunaOne Lipa
HTGOne Haitian GourdeTwo Haitian GourdesOne Centime
HUFOne Hungarian ForintTwo Hungarian ForintOne Fillér
IDROne Indonesian RupiahTwo Indonesian RupiahOne Sen
ILSOne Israeli ShekelTwo Israeli ShekelsOne Agora
IMPOne Manx PoundTwo Manx PoundsOne Penny
INROne Indian RupeeTwo Indian RupeesOne Paisa
IQDOne Iraqi DinarTwo Iraqi DinarsTen Fils
IRROne Iranian RialTwo Iranian RialsOne Dinar
ISKOne Icelandic KrónaTwo Icelandic KrónurZero Icelandic Króna
JEPOne Jersey PoundTwo Jersey PoundsOne Penny
JMDOne Jamaican DollarTwo Jamaican DollarsOne Cent
JODOne Jordanian DinarTwo Jordanian DinarsTen Fils
JPYOne Japanese YenTwo Japanese YenZero Japanese Yen
KESOne Kenyan ShillingTwo Kenyan ShillingsOne Cent
KGSOne Kyrgyz SomTwo Kyrgyz SomsOne Tyiyn
KHROne Cambodian RielTwo Cambodian RielsOne Sen
KIDOne Kiribati DollarTwo Kiribati DollarsOne Cent
KMFOne Comorian FrancTwo Comorian FrancsZero Comorian Franc
KPWOne North Korean WonTwo North Korean WonOne Chon
KRWOne South Korean WonTwo South Korean WonZero South Korean Won
KWDOne Kuwaiti DinarTwo Kuwaiti DinarsTen Fils
KYDOne Cayman Islands DollarTwo Cayman Islands DollarsOne Cent
KZTOne Kazakhstani TengeTwo Kazakhstani TengeOne Tıyn
LAKOne Lao KipTwo Lao KipOne Att
LBPOne Lebanese PoundTwo Lebanese PoundsOne Qirsh
LKROne Sri Lankan RupeeTwo Sri Lankan RupeesOne Cent
LRDOne Liberian DollarTwo Liberian DollarsOne Cent
LSLOne Lesotho LotiTwo Lesotho MalotiOne Sente
LTCOne LitecoinTwo Litecoins0.01
LYDOne Libyan DinarTwo Libyan DinarsTen Dirhams
MADOne Moroccan DirhamTwo Moroccan DirhamsOne Centime
MDLOne Moldovan LeuTwo Moldovan LeiOne Ban
MGAOne Malagasy AriaryTwo Malagasy AriaryZero Malagasy Ariary
MKDOne Macedonian DenarTwo Macedonian DenariOne Deni
MMKOne Myanmar KyatTwo Myanmar KyatOne Pya
MNTOne Mongolian TugrikTwo Mongolian TugrikOne Möngö
MOPOne Macanese PatacaTwo Macanese PatacasOne Avo
MRUOne Mauritanian OuguiyaTwo Mauritanian OuguiyaZero Mauritanian Ouguiya
MUROne Mauritian RupeeTwo Mauritian RupeesOne Cent
MVROne Maldivian RufiyaaTwo Maldivian RufiyaaOne Laari
MWKOne Malawian KwachaTwo Malawian KwachaOne Tambala
MXNOne Mexican PesoTwo Mexican PesosOne Centavo
MYROne Malaysian RinggitTwo Malaysian RinggitOne Sen
MZNOne Mozambican MeticalTwo Mozambican MeticaisOne Centavo
NADOne Namibian DollarTwo Namibian DollarsOne Cent
NGNOne Nigerian NairaTwo Nigerian NairaOne Kobo
NIOOne Nicaraguan CórdobaTwo Nicaraguan CórdobasOne Centavo
NOKOne Norwegian KroneTwo Norwegian KronerOne Øre
NPROne Nepalese RupeeTwo Nepalese RupeesOne Paisa
NZDOne New Zealand DollarTwo New Zealand DollarsOne Cent
OMROne Omani RialTwo Omani RialsTen Baisa
PABOne Panamanian BalboaTwo Panamanian BalboasOne Centésimo
PENOne Peruvian SolTwo Peruvian SolesOne Centimo
PGKOne Papua New Guinean KinaTwo Papua New Guinean KinaOne Toea
PHPOne Philippine PesoTwo Philippine PesosOne Sentimo
PKROne Pakistani RupeeTwo Pakistani RupeesOne Paisa
PLNOne Polish ZlotyTwo Polish ZlotysOne Grosz
PNDOne Pitcairn Islands DollarTwo Pitcairn Islands DollarsOne Cent
PRBOne Transnistrian RubleTwo Transnistrian RublesOne Kopek
PYGOne Paraguayan GuaraníTwo Paraguayan GuaraníesZero Paraguayan Guaraní
QAROne Qatari RiyalTwo Qatari RiyalsOne Dirham
RONOne Romanian LeuTwo Romanian LeiOne Ban
RSDOne Serbian DinarTwo Serbian DinarsOne Para
RUBOne Russian RubleTwo Russian RublesOne Kopek
RWFOne Rwandan FrancTwo Rwandan FrancsZero Rwandan Franc
SAROne Saudi RiyalTwo Saudi RiyalsOne Halalah
SBDOne Solomon Islands DollarTwo Solomon Islands DollarsOne Cent
SCROne Seychellois RupeeTwo Seychellois RupeesOne Cent
SDGOne Sudanese PoundTwo Sudanese PoundsOne Qirsh
SEKOne Swedish KronaTwo Swedish KronorOne Öre
SGDOne Singapore DollarTwo Singapore DollarsOne Cent
SHPOne Saint Helena PoundTwo Saint Helena PoundsOne Penny
SLEOne Sierra Leonean LeoneTwo Sierra Leonean LeonesOne Cent
SLLOne Sierra Leonean LeoneTwo Sierra Leonean LeonesOne Cent
SLSOne Somaliland ShillingTwo Somaliland ShillingsOne Cent
SOLOne SolTwo Sol0.01
SOSOne Somali ShillingTwo Somali ShillingsOne Senti
SRDOne Surinamese DollarTwo Surinamese DollarsOne Cent
SSPOne South Sudanese PoundTwo South Sudanese PoundsOne Qirsh
STNOne São Tomé and Príncipe DobraTwo São Tomé and Príncipe DobrasPríncipe Dobra and One Centimo
SVCOne Salvadoran ColónTwo Salvadoran ColonesOne Centavo
SYPOne Syrian PoundTwo Syrian PoundsOne Qirsh
SZLOne Swazi LilangeniTwo Swazi EmalangeniOne Cent
THBOne Thai BahtTwo Thai BahtOne Satang
TJSOne Tajikistani SomoniTwo Tajikistani SomoniOne Diram
TMTOne Turkmenistan ManatTwo Turkmenistan ManatOne Tenge
TNDOne Tunisian DinarTwo Tunisian DinarsTen Millime
TOPOne Tongan Pa'angaTwo Tongan Pa'angaOne Seniti
TRYOne Turkish LiraTwo Turkish LiraOne Kuruş
TTDOne Trinidad and Tobago DollarTwo Trinidad and Tobago DollarsTobago Dollar and One Cent
TVDOne Tuvaluan DollarTwo Tuvaluan DollarsOne Cent
TWDOne New Taiwan DollarTwo New Taiwan DollarsOne Cent
TZSOne Tanzanian ShillingTwo Tanzanian ShillingsOne Senti
UAHOne Ukrainian HryvniaTwo Ukrainian HryvniasOne Kopiyka
UGXOne Ugandan ShillingTwo Ugandan ShillingsZero Ugandan Shilling
USDOne US DollarTwo US DollarsOne Cent
USDCOne USD CoinTwo USD Coin0.01
USDTOne TetherTwo Tether0.01
UYUOne Uruguayan PesoTwo Uruguayan PesosOne Centésimo
UZSOne Uzbekistani SomTwo Uzbekistani SomOne Tiyin
VEDOne Venezuelan Bolívar DigitalTwo Venezuelan Bolívares DigitalesOne Centimo
VESOne Venezuelan BolívarTwo Venezuelan BolívaresOne Centimo
VNDOne Vietnamese DongTwo Vietnamese DongZero Vietnamese Dong
VUVOne Vanuatu VatuTwo Vanuatu VatuZero Vanuatu Vatu
WSTOne Samoan TalaTwo Samoan TalaOne Sene
XAFOne Central African CFA FrancTwo Central African CFA FrancsZero Central African CFA Franc
XCDOne East Caribbean DollarTwo East Caribbean DollarsOne Cent
XCGOne Caribbean GuilderTwo Caribbean GuildersOne Cent
XOFOne West African CFA FrancTwo West African CFA FrancsZero West African CFA Franc
XPFOne CFP FrancTwo CFP FrancsZero CFP Franc
XRPOne RippleTwo Ripple0.01
YEROne Yemeni RialTwo Yemeni RialsOne Fils
ZAROne South African RandTwo South African RandOne Cent
ZMWOne Zambian KwachaTwo Zambian KwachaOne Ngwee
ZWBOne RTGS DollarTwo RTGS DollarsZero RTGS Dollar
ZWGOne Zimbabwe GoldTwo Zimbabwe GoldOne Cent
ZWLOne Zimbabwean DollarTwo Zimbabwean DollarsOne Cent

8. Your own currency

A currency that is not in the table is named in the call: demonym (the adjective), major, minor and the plurals majorPl, minorPl, with style: "currency" and no currency.

arqam("7.5", "en-US", { style: "currency", demonym: "Mabatowan", major: "Koko", majorPl: "Kokos", minor: "Kaka", minorPl: "Kakas" })
→Seven Mabatowan Kokos and Fifty Kakas
arqam("1.01", "en-US", { style: "currency", demonym: "Mabatowan", major: "Koko", majorPl: "Kokos", minor: "Kaka", minorPl: "Kakas" })
→One Mabatowan Koko and One Kaka

9. Questions

All questions (14)

Q1Why does arqam("12.5", "en-US", {currency: "QAR"}) give an error?Beginner

As in Intl, an amount is style: "currency"; Arqam says so rather than write a plain number.

arqam("12.5", "en-US", {currency: "QAR"})
→Twelve Qatari Riyals and Fifty Dirhams
arqam("12.5", "en-US", {currency: "QAR"})
→Twelve Qatari Riyals and Fifty Dirhams
Q2How do I write "Only" as on a cheque?Beginner

only: "end" (or "start"); with brackets it comes before the figure.

arqam("99.5", "en-US", {mode: "currency", currency: "USD", only: "end", brackets: "end"})
→Ninety-Nine US Dollars and Fifty Cents Only (USD 99.50)
Q3Why does UK English give "Fifteen Thousand Four Hundred" with no "and"?Beginner

British usage puts "and" only before the tens and units: "One Thousand Two Hundred and Fifty", but "Fifteen Thousand Four Hundred".

arqam("15400", "en-GB")
→Fifteen Thousand Four Hundred
Q4How do I write ordinals (First, Twenty-First)?Beginner

mode: "o" (or "ordinals"); with style: "uk" the "and" goes in as for numbers.

arqam("21", "en-US", {mode: "o"})
→"Twenty-First"
arqam("1001", "en-GB", {mode: "o"})
→One Thousand and First
Q5How do I write the words in capitals?Intermediate

textFormat: "U"; "L" for lower case.

arqam("1250.5", "en-US", {mode: "currency", currency: "QAR", textFormat: "U"})
→ONE THOUSAND TWO HUNDRED FIFTY QATARI RIYALS AND FIFTY DIRHAMS
Q6How do I put the currency before the number?Intermediate

currencyPos: "start".

arqam("50", "en-US", {mode: "currency", currency: "EUR", currencyPos: "start"})
→Euros Fifty
Q7How do I leave out the country ("Dollars" not "US Dollars")?Intermediate

noCountry: "on".

arqam("20", "en-US", {mode: "currency", currency: "USD", noCountry: "on"})
→Twenty Dollars
Q8How do I cut the extra decimals instead of rounding them?Intermediate

roundingMode: "trunc"; by default the places beyond the currency's are rounded half up, as Intl.

arqam("9.999", "en-US", {currency: "QAR"})
→Ten Qatari Riyals
arqam("9.999", "en-US", {currency: "QAR", roundingMode: "trunc"})
→Nine Qatari Riyals and Ninety-Nine Dirhams
Q9Is there a limit on the length of a number?Intermediate

No: the scale names go on as far as the number needs (after the 999th -illion too). There is no option for it.

arqam("1000000000000000000000000000000000000", "en-US")
→One Undecillion
Q10Does it read numbers as JavaScript numbers?Intermediate

It takes the canonical text ("1234.56"), a number, or a BigInt; text is safest for large numbers and many decimals.

arqam("0.1", "en-US")
→Zero point One
Q11How do I colour the parts of the words?Advanced

split: "on" marks them: |p punctuation, |c currency names, |f| the fraction, | a group.

arqam("12.5", "en-US", {mode: "currency", currency: "QAR", split: "on"})
→Twelve Qatari Riyals and Fifty Dirhams
Q12Are the currency codes and decimals the same as the Arabic engine's?Advanced

Yes: the same table of codes, and the same number of decimals, so toBilingual() writes the same amount in both languages.

arqam.toBilingual("12.345", "KWD").en
→Twelve Kuwaiti Dinars and Three Hundred and Forty-Five Fils Only
Q13Why are some currency names not those of Intl (the browser)?Intermediate

Intl (CLDR, in every browser and in Node) has English names for most currencies, but they change from one version to the next, and some environments carry none; a cheque or a contract must read the same on every machine and in every year. So arqamEN keeps its own table, checked against ISO 4217 and the name each currency has where it is used: a plural only where its language has one (Naira, Ringgit), the plural of its own language (Reais, Colones, Maloti), and the ISO name where CLDR has a common one (Pound Sterling). The 45 currencies whose words differ from CLDR 49's English:

CodearqamEN singularCLDR singulararqamEN pluralCLDR pluralWhy
AFNAfghan AfghaniAfghan afghaniAfghan AfghaniAfghan afghanisno plural form in the currency's own language
AMDArmenian DramArmenian dramArmenian DramArmenian dramsno plural form in the currency's own language
AZNAzerbaijani ManatAzerbaijani manatAzerbaijani ManatAzerbaijani manatsno plural form in the currency's own language
BDTBangladeshi TakaBangladeshi takaBangladeshi TakaBangladeshi takasno plural form in the currency's own language (CLDR 49's British English agrees)
BMDBermudian DollarBermudan dollarBermudian DollarsBermudan dollarsISO 4217 and the currency's own name: Bermudian
BRLBrazilian RealBrazilian realBrazilian ReaisBrazilian realsthe Portuguese plural, reais
BWPBotswana PulaBotswanan pulaBotswana PulaBotswanan pulasISO 4217: Pula; the name used in Botswana: Botswana pula, unchanged in the plural
CRCCosta Rican ColónCosta Rican colónCosta Rican ColonesCosta Rican colónsthe Spanish plural, colones
CVECabo Verdean EscudoCape Verdean escudoCabo Verdean EscudosCape Verdean escudosthe country's name, Cabo Verde (ISO 4217: Cabo Verde Escudo)
ERNEritrean NakfaEritrean nakfaEritrean NakfaEritrean nakfasno plural form in the currency's own language
ETBEthiopian BirrEthiopian birrEthiopian BirrEthiopian birrsno plural form in the currency's own language (CLDR's British English agrees)
GBPPound SterlingBritish poundPounds SterlingBritish poundsthe ISO 4217 name, Pound Sterling
GELGeorgian LariGeorgian lariGeorgian LariGeorgian larisno plural form in the currency's own language
GTQGuatemalan QuetzalGuatemalan quetzalGuatemalan QuetzalesGuatemalan quetzalsthe Spanish plural, quetzales
GYDGuyanese DollarGuyanaese dollarGuyanese DollarsGuyanaese dollarsthe adjective of Guyana is Guyanese (ISO 4217: Guyana Dollar)
HRKCroatian KunaCroatian kunaCroatian KunaCroatian kunasCroatian kuna (withdrawn in 2023, kept for old documents)
HUFHungarian ForintHungarian forintHungarian ForintHungarian forintsHungarian puts no plural after a number
IDRIndonesian RupiahIndonesian rupiahIndonesian RupiahIndonesian rupiahsno plural form in the currency's own language
ILSIsraeli ShekelIsraeli new shekelIsraeli ShekelsIsraeli new shekelsthe name in daily use, shekel
KZTKazakhstani TengeKazakhstani tengeKazakhstani TengeKazakhstani tengesno plural form in the currency's own language
LAKLao KipLaotian kipLao KipLaotian kipsISO 4217: Lao Kip; no plural form in Lao
LSLLesotho LotiLesotho lotiLesotho MalotiLesotho lotisthe Sesotho plural, maloti (CLDR's British English agrees)
MGAMalagasy AriaryMalagasy ariaryMalagasy AriaryMalagasy ariariesno plural form in the currency's own language (CLDR's British English agrees)
MMKMyanmar KyatMyanmar kyatMyanmar KyatMyanmar kyatsno plural form in the currency's own language
MNTMongolian TugrikMongolian tugrikMongolian TugrikMongolian tugriksno plural form in the currency's own language
MRUMauritanian OuguiyaMauritanian ouguiyaMauritanian OuguiyaMauritanian ouguiyasno plural form in the currency's own language
MVRMaldivian RufiyaaMaldivian rufiyaaMaldivian RufiyaaMaldivian rufiyaasno plural form in the currency's own language (CLDR's British English agrees)
MWKMalawian KwachaMalawian kwachaMalawian KwachaMalawian kwachaskwacha, unchanged, as written in Malawi and Zambia
MYRMalaysian RinggitMalaysian ringgitMalaysian RinggitMalaysian ringgitsno plural form in the currency's own language
MZNMozambican MeticalMozambican meticalMozambican MeticaisMozambican meticalsthe Portuguese plural, meticais
NGNNigerian NairaNigerian nairaNigerian NairaNigerian nairasno plural form in the currency's own language
PYGParaguayan GuaraníParaguayan guaraniParaguayan GuaraníesParaguayan guaranisthe Spanish name and plural, guaraní, guaraníes
SHPSaint Helena PoundSt. Helena poundSaint Helena PoundsSt. Helena poundsthe ISO 4217 name, Saint Helena Pound
SLLSierra Leonean LeoneSierra Leonean leone (1964—2022)Sierra Leonean LeonesSierra Leonean leones (1964—2022)CLDR adds the years of a withdrawn currency
STNSão Tomé and Príncipe DobraSão Tomé & Príncipe dobraSão Tomé and Príncipe DobrasSão Tomé & Príncipe dobras«and», not «&», in words
TJSTajikistani SomoniTajikistani somoniTajikistani SomoniTajikistani somonisno plural form in the currency's own language
TMTTurkmenistan ManatTurkmenistani manatTurkmenistan ManatTurkmenistani manatISO 4217: Turkmenistan New Manat
TOPTongan Pa'angaTongan paʻangaTongan Pa'angaTongan paʻangathe apostrophe of ISO 4217 (Pa’anga), which any keyboard types
TTDTrinidad and Tobago DollarTrinidad & Tobago dollarTrinidad and Tobago DollarsTrinidad & Tobago dollars«and», not «&», in words (ISO 4217)
VEDVenezuelan Bolívar DigitalBolívar SoberanoVenezuelan Bolívares DigitalesBolívar Soberanosthe digital bolívar of 2021, with the Spanish plural
VESVenezuelan BolívarVenezuelan bolívarVenezuelan BolívaresVenezuelan bolívarsthe Spanish plural, bolívares
VUVVanuatu VatuVanuatu vatuVanuatu VatuVanuatu vatusno plural form in the currency's own language (CLDR's British English agrees)
ZMWZambian KwachaZambian kwachaZambian KwachaZambian kwachaskwacha, unchanged, as written in Zambia
ZWGZimbabwe GoldZimbabwean goldZimbabwe GoldZimbabwean goldthe ISO 4217 name, Zimbabwe Gold
ZWLZimbabwean DollarZimbabwean dollar (2009–2024)Zimbabwean DollarsZimbabwean dollars (2009–2024)CLDR adds the years of a withdrawn currency

To write a currency another way, give its names with registerCurrency(), or name it in the call, e.g. arqam("3", "en-US", {style: "currency", demonym: "Nigerian", major: "Naira", majorPl: "Nairas", minor: "Kobo", minorPl: "Kobo"}).

arqam("3", "en-US", {currency: "NGN"})
→Three Nigerian Naira
arqam("3", "en-US", {currency: "BRL"})
→Three Brazilian Reais
Q14What does it give for text that is not a number?Advanced

The isNaN option (default ""); it never throws for a bad number.

arqam("12,5", "en-US")
→""
arqam("abc", "en-US", {isNaN: "not a number"})
→not a number