private BigDecimal coerceValueInRange(BigDecimal value, BigDecimal effectiveMinValue, BigDecimal effectiveMaxValue) {
        if (value.compareTo(effectiveMinValue) < 0) {
            return effectiveMinValue;
        }
        if (value.compareTo(effectiveMaxValue) > 0) {
            return effectiveMaxValue;
        }
        return value;
    }
Coerce the provided value to the range defined by the effective minimum and maximum numbers.
@param value the value to render
@param effectiveMinValue the effective minimum value
@param effectiveMaxValue the effective maximum number
@return the value if inside the range, or else the nearest boundary that is still inside the range
primefaces/src/main/java/org/primefaces/component/inputnumber/InputNumberRenderer.java