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 :: jquery if data attribute exists 
Javascript :: angular serve 
Javascript :: remove first row from table jquery 
Javascript :: binary to int javascript 
Javascript :: get month in two digit in javascript date 
Javascript :: javascript date pipe central timezone example 
Javascript :: minecraft lang file 
Javascript :: window.scroll 
Javascript :: node cron every 10 minutes 
Javascript :: npm ERR! missing script: start 
Javascript :: clear input field jquery 
Javascript :: vuejs react on route chagne 
Javascript :: check if an object contains a value in javascript 
Javascript :: moment format a date into different format 
Javascript :: truncate a string 
Javascript :: sum of array elements in javascript 
Javascript :: queryselector a tag with text 
Javascript :: find duplicate values in array object javascript 
Javascript :: regex to indentify url 
Javascript :: sort array of object by another value array in javascript 
Javascript :: swal con input 
Javascript :: iterate through list javascript 
Javascript :: electron open new window 
Javascript :: reverse a number in javascript w3schools 
Javascript :: Regular expression: Match everything after a particular word 
Javascript :: print placeholder value js 
Javascript :: crop image canvas 
Javascript :: js get json keys 
Javascript :: TypeError: client.guilds.forEach is not a function 
Javascript :: cosnsole.log without obj object 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =