Currency Format of iLib - iLib-js/iLib GitHub Wiki
Priority of assigning sign sync with CLDR
symbol-alt-narrowof CLDR- Existing
signvalue of iLib symbolof CLDR- ISO 3-letter code for currency
Minus currency format
There is two types(standard and accounting) for currency format in CLDR. We can use both of types for currency. But accounting type is for context of accounting. So, from CLDR 26, iLib has been using standard type for minus currency format.
Below is survey result about this issue.
General purpose numbers
| Type | English Example | Meaning |
|---|---|---|
| currency | ¤#,##0.00 | Used for currency values. A currency symbol (¤) is will be replaced by the appropriate currency symbol for whatever currency is being formatted. The choice of whether to use the international currency symbols (USD, EUR, JAY, RUB,…) or localized symbols ($, €, ¥, руб.,…) is up tothe application program that uses CLDR. Note: the number of decimals will be set by programs that use CLDR to whatever is appropriate for the currency, so do not change them; keep exactly 2 decimals. |
| currency-accounting | ¤#,##0.00;(¤#,##0.00) | Used for currency formats in accounting contexts. |
If your language uses different formats for negative numbers than just adding "-" at the front, you can put in two >patterns, separated by a semicolon. The first will be used for zero and positive values, while the second will be used >for negative values. For example: #,##0.00¤;(#,##0.00¤) is used to make negative currencies appear like "(1'234,56£)" instead of "-1'234,56£". >That is used for formatting currency amounts in English, but not for general-purpose decimal numbers.
About accounting form
The element now supports both type="standard" and type="accounting"; the latter is intended for formats >specific to accounting, such as the use of parentheses to indicate a negative or debit value: “(175.50)”. Moved existing >standard patterns that used accounting style to the "accounting" variant.
Background of bringing in accounting form
One of our people brought up the issue that we are still using () with negative currency amounts. At least in English, >people would probably be more accustomed to using the minus sign instead. The parens also cause an inconsistency when a >section is presented with a common currency. I think we've just kept the () these many years from inertia... We should >consider changing the () forms to -:
- perhaps initially just for English;
- perhaps also moving the old form to an alt="accounting".