Answers for "number format javascript rupiah"

1

javascript rupiah format

const numb = 1000000;
const format = numb.toString().split('').reverse().join('');
const convert = format.match(/\d{1,3}/g);
const rupiah = 'Rp ' + convert.join('.').split('').reverse().join('')

console.log(rupiah)
Posted by: Guest on September-07-2020
0

javascript format number as currency

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

formatter.format(1000) // "$1,000.00"
formatter.format(10) // "$10.00"
formatter.format(123233000) // "$123,233,000.00"
Posted by: Guest on June-02-2021
0

javascript format rupiah

const formatter = new Intl.NumberFormat('en-ID', {
  style: 'currency',
  currency: 'IDR'
}).format(10000000)
.replace(/[IDR]/gi, '')
.replace(/(\.+\d{2})/, '')
.trimLeft()

console.log(`Rp ${formatter}`)
Posted by: Guest on January-03-2021

Code answers related to "number format javascript rupiah"

Code answers related to "Javascript"

Browse Popular Code Answers by Language