Closed
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: