formatAsCurrency
Script
v5
Fork
1
2
3
4
5
6
7
export
function
formatAsCurrency
(
num
)
{
let
formatter
=
new
Intl
.
NumberFormat
(
"en-US"
,
{
style
:
"currency"
,
currency
:
"USD"
,
}
)
;
return
formatter
.
format
(
num
)
;
}