Skip to content

An article about number, currency, and unit formatting #410

@xfq

Description

@xfq
Member

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, and round
  • support symbols like K, M, B, T
  • enable content authors to customize their own currency formats such as $123.4万

Activity

r12a

r12a commented on Jul 22, 2022

@r12a
Contributor

Seems like it would be useful.

xfq

xfq commented on Jul 22, 2022

@xfq
MemberAuthor

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

xfq commented on Jun 5, 2025

@xfq
MemberAuthor

@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”.

changed the title [-]An article about currency formatting?[/-] [+]An article about number, currency, and unit formatting[/+] on Jun 13, 2025
xfq

xfq commented on Jun 13, 2025

@xfq
MemberAuthor

Thinking about it again, I'll write this article mainly for content authors, and will write for spec developers in specdev.

added a commit that references this issue on Jun 19, 2025
ed6efb7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @xfq@r12a

      Issue actions

        An article about number, currency, and unit formatting · Issue #410 · w3c/i18n-drafts