Nodejs Float Round round5()

Here you can find the source of round5()

Method Source Code

Number.prototype.round5 = function() {
  return ((this)- (this % 5));
}

Related

  1. round(dp)
    Number.prototype.round = function(dp) {
        multiplier = Math.pow(10,dp);
        return Math.round(this*multiplier) / multiplier;
    
  2. round(places)
    Number.prototype.round = function(places) {
        return +(Math.round(this + "e+" + places)  + "e-" + places);
    function fractionToFloat(str)
    var complexParts = str.split(' ');
    var result = 0;
    var f;
    if (complexParts.length == 1) {
    ...
    
  3. round(precision)
    Number.prototype.round = function(precision) {
      var factor = Math.pow(10, precision || 0);
      return Math.round(this * factor) / factor;
    };
    
  4. round(precision)
    Number.prototype.round = function(precision){
      if (Object.isUndefined(precision)){
        return Math.round(this);
      precision = Math.pow(10, precision);
      return Math.round(this * precision) / precision;
    };
    
  5. round(precision)
    Number.prototype.round = function (precision) {
        precision = Math.pow(10, precision || 0);
        return Math.round(this * precision) / precision;
    };
    
  6. roundDecimal()
    Number.prototype.roundDecimal = function() {
      return Math.roundDecimal(this);
    };
    
  7. roundMoney(decimals = 2)
    Number.prototype.roundMoney = Number.prototype.toObject || function roundMoney(decimals = 2) {
      return Number((Math.round(this + "e" + decimals) + "e-" + decimals));
    };
    
  8. roundNumber.prototype.round || (precision)
    Number.prototype.round = Number.prototype.round || function (precision) {
      return Math.round(this * Math.pow(10, (precision || 2))) / Math.pow(10, (precision || 2))
    
  9. roundTo()
    Number.prototype.roundTo = function() {
        return 32 * Math.round(this / 32);