Answers for "format currency javascript"

6

format amount in javascript

const formatToCurrency = amount => {
  return "$" + amount.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, "$&,");
};
formatToCurrency(12.34546); //"$12.35"
formatToCurrency(42345255.356); //"$42,345,255.36
Posted by: Guest on December-30-2019
2

javascript format currency

function formatToCurrency(amount){
    return (amount).toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,'); 
}
formatToCurrency(12.34546); //"12.35"
formatToCurrency(42345255.356); //"42,345,255.36"
Posted by: Guest on July-12-2020
1

format currency javascript

const formatter = new Intl.NumberFormat('en-US', {
  style: 'currency',
  currency: 'USD',
  minimumFractionDigits: 2
})

formatter.format(1000) // "$1,000.00"
formatter.format(10) // "$10.00"


-----------------------------------------------------
const formatter = new Intl.NumberFormat('vi-VN', {
  style: 'currency',
  currency: 'VND',
  minimumFractionDigits: 0
})


$('.total-price').html(formatter.format(price)); // 25.000đ
Posted by: Guest on September-30-2021
-3

format currency javascript

Steve
Posted by: Guest on February-18-2021
-3

format currency javascript

Steven Jasper C
Posted by: Guest on February-18-2021
-3

format currency javascript

Steven Jasper Calcaro
Posted by: Guest on February-18-2021

Code answers related to "format currency javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language