code: static int round(int value, int precision, int significantDigits) {
  		if (precision > 0) {
  			value = (value + precision / 2) / precision * precision;
  		}
  		if (significantDigits > 0) {
  			int forRounding = value;
  			int precisionMax = (int) Math.pow(10, significantDigits);
  			int multiplier = 1;
  			while (value > precisionMax) {
  				forRounding = value;
  				multiplier *= 10;
  				value /= 10;
  			}
  			if (forRounding % 10 >= 5) {
  				value++;
  			}
  			value *= multiplier;
  		}
  		return value;
  	}
docs: Round integer number by applying precision and maximum significant digits.
  
  @param value value to round
  @param precision precision
  @param significantDigits significant digits
  @return rounded value