removing commas in numbers

scottjus82
Kilo Guru

Morning all,

I am importing some data from an old system into ServiceNow, the reference number from the previous system will go into a custom field in ServiceNow. This is working however it is adding a comma so the number becomes 32,546 instead of 32546. How do I stop this happening?

Regards

19 REPLIES 19

thanks for the help so far.



So I have tried both cell edit and on change as they reference the field this needs to apply to and neither work. What am I doing wrong?


Why don't you go for replace method . Its simple thing.


can you plz let us know what kind of value ur getting in script.


we need to convert it in string then we can perform the above function.



Thanks


I had used this a long back



var mystring = knowledge.u_search_term.toString(); //field where the comma separated text is present


var newchar = '';


mystring = mystring.split(',').join(newchar);


Anurag Tripathi
Mega Patron
Mega Patron

make the type of the field in SN string....and then use any of the str.replace() methods suggested above


-Anurag