Skip to content
Advertisement

Javascript showing in dollars

How would I display JavaScript output numbers in dollar format? I.E. $20.00 then $2,000.00 when the number gets larger. Ok so sample code.

JavaScript

Advertisement

Answer

Here’s the function that I use.. Basically the same as @Senad’s except it adds commas:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement