Skip to content

Commit 0f3f4f4

Browse files
danielkaradachkigyoshev
authored andcommitted
docs: document accounting format
1 parent a3e34bf commit 0f3f4f4

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

docs/num-formatting/api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Specifies the format style.
3333
The supported values are:
3434
* `"decimal"`
3535
* `"currency"`
36+
* `"accounting"`
3637
* `"percent"`
3738
* `"scientific"`
3839

docs/num-formatting/index.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,16 @@ Standard number formatting can be specified by passing an options object or a st
4343

4444
formatNumber(1234.5678, "c5", "bg"); // 1 234,56780 лв
4545

46+
* **The `"a"` specifier**—Same as `"c"` but uses the currency accounting format.
47+
48+
> The locale numbers `currencies` data and the supplemental `currencyData` must be loaded for the currency formatting to work.
49+
50+
import { formatNumber } from '@telerik/kendo-intl';
51+
52+
formatNumber(-1234.5678, "a"); // ($1,234.57)
53+
54+
formatNumber(1234.5678, "a3", "de-CH"); // 1’234.568 CHF
55+
4656
* **The `"p"` specifier**—Formats the number as a percentage based on the locale. The passed number is multiplied by 100. To specify precision, add a number after `"p"`. By default, the number is formatted and rounded to zero decimal digits.
4757

4858
import { formatNumber } from '@telerik/kendo-intl';
@@ -69,7 +79,7 @@ Standard number formatting can be specified by passing an options object or a st
6979
}); // 1,234.5678
7080

7181
formatNumber(1234.5678, {
72-
style: "currency",
82+
style: "currency",
7383
currency: "EUR",
7484
currencyDisplay: "displayName"
7585
}, "bg"); // 1 234,57 евро
@@ -90,7 +100,7 @@ The supported format specifiers are:
90100

91101
import { formatNumber } from '@telerik/kendo-intl';
92102

93-
formatNumber(1234.5678, "00000"); // 01235
103+
formatNumber(1234.5678, "00000"); // 01235
94104

95105
* **The `"#"` specifier**—A digit placeholder. It replaces the Pound sign with the corresponding digit if one is present. Otherwise, no digit appears in the result string.
96106

src/numbers.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export interface NumberFormatOptions {
66
/**
77
* Specifies the format style.
88
*/
9-
style?: 'decimal' | 'currency' | 'percent' | 'scientific';
9+
style?: 'decimal' | 'currency' | 'percent' | 'scientific' | 'accounting';
1010

1111
/**
1212
* Defines the currency code of the currency that is used in the formatting.

0 commit comments

Comments
 (0)