Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove comma from number which comes dynamically in .tpl file

i want to remove comma from a number (e.g change 1,125 to 1125 ) in a .tpl file. The value comes dynamically like ${variableMap[key]}

like image 901
Sree Avatar asked Sep 24 '12 05:09

Sree


People also ask

How to remove comma from number in js?

var a='1,125'; a=a. replace(/\,/g,''); // 1125, but a string, so convert it to number a=parseInt(a,10);

How do I remove commas from a number in Python?

In our first python program code, we use replace() method to eliminate all the commas (,) from a python string. The replace() command returns a replica of the string where a substring's existence is exchanged with another substring. Using replace() function, we swap the commas in the python string with null elements.


1 Answers

var a='1,125'; a=a.replace(/\,/g,''); // 1125, but a string, so convert it to number a=parseInt(a,10); 

Hope it helps.

like image 58
web-nomad Avatar answered Oct 05 '22 14:10

web-nomad