removing commas in numbers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2015 02:59 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2015 04:25 AM
while doing that before inserting you can change the value and update.
EX:
var str = '32,546';
var res = str.replace(",", "");
alert(res);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2015 01:05 AM
Hey all,
I have tried all three of the above and I cant get any working.
Any thoughts?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2015 01:11 AM
hi
try this.
var removed = '';
var str = '32,546';
var res = str.split(',');
for(var i=0; i<res.length; i++)
{
removed += res[i];
}
alert(removed);
Thanks
Basha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2015 01:13 AM
HI,
Thanks for the quick response, can you confirm if this is in a client script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2015 01:14 AM
Yep