Set rounding mode to use when it becomes necessary.
492366
public MonetaryFormat roundingMode(RoundingMode roundingMode) {
        if (roundingMode == this.roundingMode)
            return this;
        else
            return new MonetaryFormat(negativeSign, positiveSign, zeroDigit, decimalMark, minDecimals, decimalGroups,
                    shift, roundingMode, codes, codeSeparator, codePrefixed);
    }
230749
def _round(self):
        
        layer = self.defaultLayer
        layer.round()
        self.info.round()
        self.kerning.round()
        for guideline in self.guidelines:
            guideline.round()
1146682
def set_level(self, val):
        """"""
        if val == 0:
            self.off()
        elif val == 255:
            self.on()
        else:
            setlevel = 255
            if val < 1:
                setlevel = val * 255
            elif val <= 0xff:
                setlevel = val
            change = setlevel - self._value
            increment = 255 / self._steps
            steps = round(abs(change) / increment)
            print('Steps: ', steps)
            if change > 0:
                method = self.brighten
                self._value += round(steps * increment)
                self._value = min(255, self._value)
            else:
                method = self.dim
                self._value -= round(steps * increment)
                self._value = max(0, self._value)
            # pylint: disable=unused-variable
            for step in range(0, steps):
                method(True)
            self._update_subscribers(self._value)
920771
def _round(self):
        
        x, y = self.offset
        x = normalizers.normalizeRounding(x)
        y = normalizers.normalizeRounding(y)
        self.offset = (x, y)
257097
def _smart_round(figure, width=10, max_decimal=4):
    """"""
    n_digits = len(str(int(figure)))
    n_decimal = width - (n_digits + 1)
    if n_decimal <= 1:
        return str(int(figure))
    else:
        n_decimal = min(n_decimal, max_decimal)
        format_str = "%." + str(n_decimal) + "f"
        return format_str % figure
1127289
def round(value)
      # If the number is within epsilon of X.5, round up (or down for negative
      # numbers).
      mod = value % 1
      mod_is_half = (mod - 0.5).abs < Script::Value::Number.epsilon
      if value > 0
        !mod_is_half && mod < 0.5 ? value.floor : value.ceil
      else
        mod_is_half || mod < 0.5 ? value.floor : value.ceil
      end
    end
548009
def set_mode(self, mode, value=None):
        
        if mode in self.user_modes:
            self.mode_users[mode][value] = 1
        else:
            self.modes[mode] = value
347547
private function round($value, $precision)
    {
        $precision = $this->getUninitializedPrecision($value, $precision);

        $roundingModeAttribute = $this->getAttribute(self::ROUNDING_MODE);
        if (isset(self::$phpRoundingMap[$roundingModeAttribute])) {
            $value = round($value, $precision, self::$phpRoundingMap[$roundingModeAttribute]);
        } elseif (isset(self::$customRoundingList[$roundingModeAttribute])) {
            $roundingCoef = pow(10, $precision);
            $value *= $roundingCoef;
            $value = (float) (string) $value;

            switch ($roundingModeAttribute) {
                case self::ROUND_CEILING:
                    $value = ceil($value);
                    break;
                case self::ROUND_FLOOR:
                    $value = floor($value);
                    break;
                case self::ROUND_UP:
                    $value = $value > 0 ? ceil($value) : floor($value);
                    break;
                case self::ROUND_DOWN:
                    $value = $value > 0 ? floor($value) : ceil($value);
                    break;
            }

            $value /= $roundingCoef;
        }

        return $value;
    }
885626
def _RoundTowardZero(value, divider):
  """"""
  # For some languanges, the sign of the remainder is implementation
  # dependent if any of the operands is negative. Here we enforce
  # "rounded toward zero" semantics. For example, for (-5) / 2 an
  # implementation may give -3 as the result with the remainder being
  # 1. This function ensures we always return -2 (closer to zero).
  result = value // divider
  remainder = value % divider
  if result < 0 and remainder > 0:
    return result + 1
  else:
    return result
1134205
def _round(ctx, number, num_digits):
    
    number = conversions.to_decimal(number, ctx)
    num_digits = conversions.to_integer(num_digits, ctx)

    return decimal_round(number, num_digits, ROUND_HALF_UP)
894297
def round(digits = nil)
      rounded_value = digits ? value.round(digits) : value.round
      self.class.new(rounded_value, unit)
    end
995596
public static final Function<BigDecimal,BigDecimal> roundBigDecimal(final int scale, final RoundingMode roundingMode) {
        return new RoundBigDecimal(scale, roundingMode);
    }
379477
public void reset() {
    this.formatMode = null;
    this.roundMode = NumberRoundMode.ROUND;
    this.grouping = null;
    this.minimumIntegerDigits = null;
    this.maximumFractionDigits = null;
    this.minimumFractionDigits = null;
    this.maximumSignificantDigits = null;
    this.minimumSignificantDigits = null;
  }
167972
def _round(self, **kwargs):
        
        mathInfo = self._toMathInfo(guidelines=False)
        mathInfo = mathInfo.round()
        self._fromMathInfo(mathInfo, guidelines=False)
886550
public BigDecimal compute(int scale, RoundingMode mode) {
    return numerator.divide(denominator, scale, mode).stripTrailingZeros();
  }
519523
def rounddown(ctx, number, num_digits):
    
    number = conversions.to_decimal(number, ctx)
    num_digits = conversions.to_integer(num_digits, ctx)

    return decimal_round(number, num_digits, ROUND_DOWN)
462508
def roundup(ctx, number, num_digits):
    
    number = conversions.to_decimal(number, ctx)
    num_digits = conversions.to_integer(num_digits, ctx)

    return decimal_round(number, num_digits, ROUND_UP)