Nodejs Currency Parse fromCurrency()

Here you can find the source of fromCurrency()

Method Source Code

String.prototype.fromCurrency = function(){
  //this regEx removes comma in the currency value
  var num = this.replace(/\,/g, "");
  return parseFloat(num);
};

Related

  1. fromCurrency()
    String.prototype.fromCurrency = function() {
      var pattern = /,\s*/g;
      return parseFloat(this.replace(pattern, ""));
    };
    
  2. fromCurrency()
    String.prototype.fromCurrency = function() {
      return Number(this.replace(/,/g, ''));
    };
    
  3. fromCurrency()
    String.prototype.fromCurrency = function() {
      return Number(this.replace(/,/g, ""));