Nodejs Number Calculate getValue(arguments)

Here you can find the source of getValue(arguments)

Method Source Code

var BigNumber = function(n){
  this.value = n.toString();//from   w ww. j  ava  2s. c o  m

  this.getValue = function(){
    return this.value;
  }

  this.getRealValue = function(){
    return Number(this.value);
  }

  this.add = function(bnum){

    return new BigNumber(Number(this.getValue()) + Number(bnum.getValue()));
  }
}

Number.prototype.getValue = function (arguments) {
  return new BigNumber(this);
}

Related

  1. getDecimalgetDecimal()
    Number.prototype.getDecimal = function getDecimal() {
        return parseInt(this, 10);
    };
    
  2. getDisplayText(number)
    Number.getDisplayText = function(number) {
        if (number < 1000) {
            return number;
        if (number < 1000000) {
            return (number / 1000).toFixed(1) * 1 + "k";
        return (number / 1000000).toFixed(1) * 1 + "m";
    };
    ...
    
  3. getHashCode()
    Number.prototype.getHashCode = function () {
        var x = this;
        x = ((x >> 16) ^ x) * 0x45d9f3b;
        x = ((x >> 16) ^ x) * 0x45d9f3b;
        x = ((x >> 16) ^ x);
        return x;
    };
    
  4. getHisByMs()
    Number.prototype.getHisByMs=function(){
        var ms=this;
        var date=new Date(ms);
        var his=[];
        his.push(Number(date.getHours()).addZero());
        his.push(Number(date.getMinutes()).addZero());
        his.push(Number(date.getSeconds()).addZero());
        return his;
    
  5. getPrecisiongetPrecision(length)
    Number.prototype.getPrecision = function getPrecision(length) {
        var value = parseFloat(this);
        if (Number.isFloat(value)) {
            return value.toString().split(".")[1].length;
        return 0;
    };
    
  6. greaterThan(num)
    Number.prototype.greaterThan = function(num) {
        return this > num;
    
  7. gt(right) return this > right };
    Number.prototype.gt = function(right) { return this > right };
    Number.prototype.ge = function(right) { return this >= right };
    Number.prototype.lt = function(right) { return this < right };
    Number.prototype.le = function(right) { return this <= right };
    Number.prototype.eq = function(right) { return this == right };
    Number.prototype.ne = function(right) { return this != right };
    
  8. hasDiv( n )
    Number.prototype.hasDiv = function( n ) {
      return Number.isInteger( this / n )
    function sum( ary ) {
      var out = 0
      for (var n in ary)  {
        out += ary[n]
      return out
    ...
    
  9. hasMult( n )
    Number.prototype.hasMult = function( n ) {
      return Number.isInteger( this / n )
    function fun100() {
      out = []
      for ( var i = 1; i <= 100; i++ ) {
        if ( i.hasMult(3) ) {
          out.push['Fizz']
        else if ( i.hasMult(5) ) {
          out.push['Buzz']
        else if ( i.hasMult(5) && i.hasMolt(3) ) {
          out.push["Fizzbuzz"]
        else {
          out.push( i.toString() )
      return out