Javascript Number toFixedNumber(x, base)

Description

Javascript Number toFixedNumber(x, base)


Number.prototype.toFixedNumber = function(x, base){
  var pow = Math.pow(base||10,x);
  return +( Math.round(this*pow) / pow );
};



PreviousNext

Related