simon551
IS-IT--Management
- May 4, 2005
- 249
Having a problem with numeric values that contain commas.
This returns 2.
Obviously I need it to return "2915.75". I'm not good with regex. Is there a simple function to do this?
This returns 2.
Code:
$(document).ready(function() {
var x = "2,915.75";
x= parseFloat(x);
alert(x);
});
Obviously I need it to return "2915.75". I'm not good with regex. Is there a simple function to do this?