-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
TypeScript Version: 3.9.2
Search Terms: NumberFormatOptions compactDisplay signDisplay
Code
console.log(new Intl.NumberFormat('en', {
currency: 'USD',
signDisplay: 'never',
style: 'currency',
}).format(-1.5));
console.log(new Intl.NumberFormat('en', {
compactDisplay: 'long',
notation: 'compact'
}).format(100000));Expected behavior:
compactDisplay and signDisplay should be usable for NumberFormatOptions.
Actual behavior:
Argument of type '{ currency: string; signDisplay: string; style: string; }' is not assignable to parameter of type 'NumberFormatOptions'. Object literal may only specify known properties, and 'signDisplay' does not exist in type 'NumberFormatOptions'.
Argument of type '{ compactDisplay: string; notation: string; }' is not assignable to parameter of type 'NumberFormatOptions'. Object literal may only specify known properties, and 'compactDisplay' does not exist in type 'NumberFormatOptions'.
Related Issues:
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue