( value: number, options?: Intl.NumberFormatOptions, )
| 13 | }; |
| 14 | |
| 15 | export const formatCurrency = ( |
| 16 | value: number, |
| 17 | options?: Intl.NumberFormatOptions, |
| 18 | ): string => { |
| 19 | if (typeof value !== 'number') { |
| 20 | return ''; |
| 21 | } |
| 22 | |
| 23 | return value.toLocaleString(['en-US'], { |
| 24 | minimumFractionDigits: 2, |
| 25 | maximumFractionDigits: 2, |
| 26 | ...options, |
| 27 | }); |
| 28 | }; |
| 29 | |
| 30 | export const formatCoresCurrency = (value: number): string => { |
| 31 | if (value > 100_000) { |
no outgoing calls
no test coverage detected