Nodejs Number Calculate double()

Here you can find the source of double()

Method Source Code

Number.prototype.double = function() {
  return this * 2;
};

Related

  1. decimalPlaces(digits)
    Number.prototype.decimalPlaces = function(digits) {
        var re = new RegExp("(\\d+\\.\\d{" + digits + "})(\\d)"),
            m = this.toString().match(re);
        return m ? parseFloat(m[1]) : this.valueOf();
    };
    
  2. decorateFloat(decimals, decSeparator)
    Number.prototype.decorateFloat = function (decimals, decSeparator) {
      if(decSeparator == undefined)
        decSeparator = '.';
      var price = this;
      var decPattern = '';
      for(var i = 0; i < decimals; i++)
        decPattern += '0';
      price = price.roundFloat(decimals);
      var split = price.toString().split('.');
    ...
    
  3. digits()
    Number.prototype.digits = function() {
        return (Math.floor(this)+"").replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,");
    };
    
  4. discountPercentage(val)
    Number.prototype.discountPercentage = function(val){
      return this - this.percentage(val);
    };
    
  5. div10()
    Number.prototype.div10 = function () {
      return this/10;
    Object.prototype.say = function (s) {
     console.log('I say ' + s);
    var o = {};
    o.say("Hello");
    var n = 120;
    ...
    
  6. doubleDigitalize()
    "use strict";
    Number.prototype.doubleDigitalize = function() {
      const numberString = this.toString();
      return numberString.length < 2 ? "0" + numberString : numberString;
    };
    
  7. equals(another)
    Number.prototype.equals = function (another) {
        return this - another === 0;
    };
    
  8. exp()
    Number.prototype.exp = function() {
      return Math.exp(this);
    };
    
  9. fe(x)
    Number.prototype.fe = function(x)
      var s = x.toString();
      var point = s.search(/\./);
      if (point == -1)
        return (Math.abs(this - x) < 0.5);    
      else
    ...