I have this PHP code below which can format product price. I want to do this same task with javascript. Is there any way to do this same task with javascript?
<?php echo number_format($saved_vehicles->Fields('basic_price'), 2, '.', ','); ?>
var number = 123456.789;
console.log(new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(number));
// → 123.456,79 €
console.log(new Intl.NumberFormat('ru-RU', { style: 'currency', currency: 'RUB' }).format(number));
// → 123 456,79 руб.
console.log(new Intl.NumberFormat('ja-JP', { style: 'currency', currency: 'JPY' }).format(number))
// → ¥123,457
console.log(new Intl.NumberFormat('en-IN', { maximumSignificantDigits: 3 }).format(number));
// → 1,23,000
your need to use Intl.NumberFormat. I think it's your choise