9951 explained code solutions for 126 technologies


javascriptFormat number as currency string (money)


(new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' })).format(99999);ctrl + c
new Intl.NumberFormat

instantiates JS native formatter (docs)

style: 'currency', currency: 'USD'

pick currency style and set the currency itself

99999

number we're going to format as money