Menu
Hi All,
How would I go about extracting a number from a string value. I have a form in which users can enter monitary values. I have no idea what they will enter so I want to extract the number including decimal from whatever they enter. For example if the user enters $134,876.00 I want to extract 134876.00.
I am trying to use a regular expression to accomlish this but can’t seem to get it to return a single number. It returns an array if the number is broken up in the middle.
[code]var x = 123adv456.8;
var r = x.match(/[0-9.]+/g);
Thanks in advance for any help.
_t