Here you can find the source of fromCurrency()
String.prototype.fromCurrency = function() { /**//from ww w. j a v a2 s . c o m * Return a Number representation of a currency string, * e.g 12,345.67 => 12345.67 * Return NaN if the string is non-numerical. */ return Number(this.replace(/,/g, '')); };
String.prototype.fromCurrency = function() { var pattern = /,\s*/g; return parseFloat(this.replace(pattern, "")); };
String.prototype.fromCurrency = function(){ var num = this.replace(/\,/g, ""); return parseFloat(num); };
String.prototype.fromCurrency = function() { return Number(this.replace(/,/g, ""));