<script> let numberFormat = new Intl.NumberFormat('ja') let price = 123456789; console.log(numberFormat.format(price)); </script>
<script> let price = 123456789; console.log(number_format(price)); function number_format(num) { return num.toString().replace(/([0-9]+?)(?=(?:[0-9]{3})+$)/g, '$1,'); } </script>