You could pick out numbers from an arbitrary string with regex:
var match= string.match(/[0-9,.]*/);
if (match!==null) {
var amount= parseFloat( match[0].replace(/,/g, '') ); // replace , thousands separator
}
However! It's generally a no-no to store money amounts in a floating point type due to the inaccuracy of floating point calculations. Of course JavaScript only gives you floating-point numbers, but by sticking to whole numbers (eg. of cents) you get accurate calculations up to the odd quadrillion.
Best of all for dealing with money is to use a decimal arithmetic type. This isn't a built-in type in JavaScript, but here's an implementation of it. (It is, unfortunately, rather heavyweight... I'm thinking of hacking up a simpler implementation of just the basics for trivial cases where you only need basic arithmetic.)
I'm also interested to know how to replace alphabetic characters to say '*'
regex again:
string.replace(/[A-Z]/gi, '*')
(for values of “alphabetic characters” within ASCII. If you need non-ASCII Unicode letters to be replaced you'd have to construct a much more involved character class... JavaScript doesn't have built-in classes for the metadata of the whole Unicode character set.)