mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-26 09:19:04 -05:00
Add currency sign to NumberFormatOptions type (#40709)
This commit is contained in:
1
src/lib/es5.d.ts
vendored
1
src/lib/es5.d.ts
vendored
@@ -4284,6 +4284,7 @@ declare namespace Intl {
|
||||
style?: string;
|
||||
currency?: string;
|
||||
currencyDisplay?: string;
|
||||
currencySign?: string;
|
||||
useGrouping?: boolean;
|
||||
minimumIntegerDigits?: number;
|
||||
minimumFractionDigits?: number;
|
||||
|
||||
6
tests/baselines/reference/numberFormatCurrencySign.js
Normal file
6
tests/baselines/reference/numberFormatCurrencySign.js
Normal file
@@ -0,0 +1,6 @@
|
||||
//// [numberFormatCurrencySign.ts]
|
||||
const str = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).format(999999);
|
||||
|
||||
|
||||
//// [numberFormatCurrencySign.js]
|
||||
var str = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).format(999999);
|
||||
12
tests/baselines/reference/numberFormatCurrencySign.symbols
Normal file
12
tests/baselines/reference/numberFormatCurrencySign.symbols
Normal file
@@ -0,0 +1,12 @@
|
||||
=== tests/cases/compiler/numberFormatCurrencySign.ts ===
|
||||
const str = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).format(999999);
|
||||
>str : Symbol(str, Decl(numberFormatCurrencySign.ts, 0, 5))
|
||||
>new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).format : Symbol(Intl.NumberFormat.format, Decl(lib.es5.d.ts, --, --))
|
||||
>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
|
||||
>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --))
|
||||
>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
|
||||
>style : Symbol(style, Decl(numberFormatCurrencySign.ts, 0, 44))
|
||||
>currency : Symbol(currency, Decl(numberFormatCurrencySign.ts, 0, 63))
|
||||
>currencySign : Symbol(currencySign, Decl(numberFormatCurrencySign.ts, 0, 80))
|
||||
>format : Symbol(Intl.NumberFormat.format, Decl(lib.es5.d.ts, --, --))
|
||||
|
||||
20
tests/baselines/reference/numberFormatCurrencySign.types
Normal file
20
tests/baselines/reference/numberFormatCurrencySign.types
Normal file
@@ -0,0 +1,20 @@
|
||||
=== tests/cases/compiler/numberFormatCurrencySign.ts ===
|
||||
const str = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).format(999999);
|
||||
>str : string
|
||||
>new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).format(999999) : string
|
||||
>new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).format : (value: number) => string
|
||||
>new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }) : Intl.NumberFormat
|
||||
>Intl.NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; }
|
||||
>Intl : typeof Intl
|
||||
>NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; }
|
||||
>'en-NZ' : "en-NZ"
|
||||
>{ style: 'currency', currency: 'NZD', currencySign: 'accounting' } : { style: string; currency: string; currencySign: string; }
|
||||
>style : string
|
||||
>'currency' : "currency"
|
||||
>currency : string
|
||||
>'NZD' : "NZD"
|
||||
>currencySign : string
|
||||
>'accounting' : "accounting"
|
||||
>format : (value: number) => string
|
||||
>999999 : 999999
|
||||
|
||||
1
tests/cases/compiler/numberFormatCurrencySign.ts
Normal file
1
tests/cases/compiler/numberFormatCurrencySign.ts
Normal file
@@ -0,0 +1 @@
|
||||
const str = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).format(999999);
|
||||
Reference in New Issue
Block a user