From 8270080e8064c06fb95334d62ced782eb1eb38d7 Mon Sep 17 00:00:00 2001 From: ccosmincc Date: Tue, 1 Aug 2023 22:56:40 +0200 Subject: [PATCH] docs(transloco-locale): add sign display number format option (#671) --- docs/docs/plugins/locale.mdx | 1 + libs/transloco-locale/src/lib/transloco-locale.types.ts | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/docs/plugins/locale.mdx b/docs/docs/plugins/locale.mdx index fe2fdd882..ce0348b0c 100644 --- a/docs/docs/plugins/locale.mdx +++ b/docs/docs/plugins/locale.mdx @@ -245,6 +245,7 @@ Note the format option of the global, locale's format and the one's being passed - `maximumFractionDigits`- The maximum number of fraction digits to use. Possible values are from 0 to 20 (default is 3). - `minimumSignificantDigits`- The minimum number of significant digits to use. Possible values are from 1 to 21 (default is 1). - `maximumSignificantDigits`- The maximum number of significant digits to use. Possible values are from 1 to 21 (default is 21). +- `signDisplay`- When to display the sign for the number. Possible values are "auto", "always", "exceptZero", "negative", "never" (default is "auto"). ## Date Format Options diff --git a/libs/transloco-locale/src/lib/transloco-locale.types.ts b/libs/transloco-locale/src/lib/transloco-locale.types.ts index 7191aff88..e6db20f62 100644 --- a/libs/transloco-locale/src/lib/transloco-locale.types.ts +++ b/libs/transloco-locale/src/lib/transloco-locale.types.ts @@ -30,7 +30,11 @@ export interface NumberFormatOptions { /** * The maximum number of significant digits to use. Possible values are from 1 to 21 */ - maximumSignificantDigits?: number; + maximumSignificantDigits?: Intl.NumberFormatOptions['maximumSignificantDigits']; + /** + * When to display the sign for the number. Possible values are "auto", "always", "exceptZero", "negative", "never"; the default is "auto". + */ + signDisplay?: Intl.NumberFormatOptions['signDisplay']; } /**