-
Notifications
You must be signed in to change notification settings - Fork 64
Description
Can we write an article about currency? It's useful for both spec developers and content authors.
Here are some concepts we can mention:
Decimal separator
Some regions use a period (.) as a separator to separate the integer part from the fractional part. Some regions use a comma (,). Some regioins use the currency symbol (such as the Cape Verdean escudo).
Currencies can have two decimals (like GBP), three decimals (like BHD), or no decimals (like VND).
Digit grouping
Some regions use a comma to separate thousands. Some regions use a period for this purpose.
Some regions use 2-digit grouping or 4-digit grouping.
Negative currency
The negative sign can be used:
- before both the currency symbol and number
- before the number but after the currency symbol
- after the number
Alternatively, the number can be displayed with parentheses around it or even in a colour such as red.
Numbering system
Numbers can be European numerals or locale-specific (such as Chinese/Japanese or Devanagari).
Currency symbol
It can be a pre-defined symbol such as the European Euro '€' or a combination of letters like the use of 'CNY' for Renminbi yuan.
It can be placed before or after the digits.
The same currency symbol may represent multiple currencies.
API
When designing a currency formatting API, it should:
- let the content author choose whether to show the digit grouping (like the thousands separator)
- let the content author round the number, and choose among
ceil
,floor
, andround
- support symbols like K, M, B, T
- enable content authors to customize their own currency formats such as
$123.4万
Activity
r12a commentedon Jul 22, 2022
Seems like it would be useful.
xfq commentedon Jul 22, 2022
Thinking about it again, some points above are useful outside of currency (like digit grouping).
Perhaps we need two articles? One for number formats and one for currency formats.
xfq commentedon Jun 5, 2025
@r12a and I discussed this offline and decided that it would be a good idea to have an article called something like “Number and Currency Formatting”.
[-]An article about currency formatting?[/-][+]An article about number, currency, and unit formatting[/+]xfq commentedon Jun 13, 2025
Thinking about it again, I'll write this article mainly for content authors, and will write for spec developers in specdev.
Initial draft on number formatting