convert number to indian rupee format in javascript
var x=12345678;
x=x.toString();
var lastThree = x.substring(x.length-3);
var otherNumbers = x.substring(0,x.length-3);
if(otherNumbers != '')
lastThree = ',' + lastThree;
var res = otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree;
alert(res);
Also in JavaScript:
- how react work
- nodejs express return image
- jquery remove class
- Javascript format date / time
- bajar archivos node
- javascript on script loaded
- socket io query
- define two variables in one line javascript
- find length of longest string in array javascript
- javascript string interpolation
- initialize a map js
- interceptor error handling angular 9
- compare two dates using moment
- nodejs express routing
- cannot concatenate object of type "<class 'str'>"; only pd.Series, pd.DataFrame, and pd.Panel (deprecated) objs are valid
- javascript upload file button
- lemon get node from id
- vue test utils mapgetter
- web worker multiple data
- javascript dictionary
- javascript loop through object example
- javascript find area of triangle
- angular form validation
- get value in maps loop using enzym