Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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)
Comment

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}`)
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript sort object by key 
Javascript :: javascript explode 
Javascript :: react native open phone 
Javascript :: javascript integer length 
Javascript :: how to add two elements in one path in react router v6 
Javascript :: replace object in array javascript 
Javascript :: jquery open image in new tab 
Javascript :: nl2br in jquery 
Javascript :: how To clear all the input element inside div using jquery 
Javascript :: react useeffect async 
Javascript :: javascript fill array with range 
Javascript :: detect user browser javascript 
Javascript :: validate age javascript 
Javascript :: remove first char javascript 
Javascript :: js select and copy on click 
Javascript :: nextjs path alias 
Javascript :: javascipt get last element of array 
Javascript :: append before parent jquery 
Javascript :: style font size javascript 
Javascript :: java scipt 
Javascript :: react native get navigation bar height 
Javascript :: extract numbers from a string javascript 
Javascript :: call a function when page is loaded 
Javascript :: reactjs firebase nested arrays are not supported 
Javascript :: angular maxlength directive input type number 
Javascript :: get the value of a checkbox jquery 
Javascript :: how to cut a string in js 
Javascript :: chrome is not defined 
Javascript :: jest array contain object with prop 
Javascript :: Mongoose - populate nested array 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =