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:
Activity
DanielRosenwasser commentedon Aug 21, 2020
Thanks!
formatAmount
helper [Fixes #327] ethereum/clrfund#346daniyaniazi commentedon Apr 1, 2022
Hey , I am facing this issue any solution yet
yassin-assim commentedon Aug 24, 2022
I have the same issue with currencyDisplay:
Argument type { minimumFractionDigits: number, currencyDisplay: string, style: string, currency: string } is not assignable to parameter type NumberFormatOptions | undefined