In c# you can do this
String.format(5000, "$###,###,##0.00;-$###,###,##0.00;$0.00")
Which will output: $5,000
Or you can do this
String.format(-5000, "$###,###,##0.00;-$###,###,##0.00;$0.00")
Which will output: -$5,000
How do I do the same in Javascript??
UPDATE: I would also need to format a currency like this
String.format(-5000, "###.###.##0.00€;-###,###,##0.00€;0.00€")
Which would output: 5.000,00 €