Answers for "Given a positive integer n representing the amount of cents you have, return the formatted currency amount. For example, given n = 123456, return "1,234.56""

9

how to format money as currency string

(12345.67).toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');  // 12,345.67
Posted by: Guest on February-23-2020
2

js format urcurency

// Create our number formatter.
var formatter = new Intl.NumberFormat('en-US', {
  style: 'currency',
  currency: 'USD',
});

formatter.format(2500); /* $2,500.00 */
Posted by: Guest on June-26-2020

Code answers related to "Given a positive integer n representing the amount of cents you have, return the formatted currency amount. For example, given n = 123456, return "1,234.56""

Code answers related to "Javascript"

Browse Popular Code Answers by Language