public static BigDecimal roundUp(final BigDecimal n, final int p) {
        if (n == null) {
            return null;
        }
        final int scale = n.scale();
        return BigDecimalUtil.setScale(BigDecimal.valueOf(roundUp(n.doubleValue(), p)), scale);
    }
public static BigDecimal roundUp ( final BigDecimal n , final int p ) { if ( n == null ) { return null ; } final int scale = n . scale ( ) ; return BigDecimalUtil . setScale ( BigDecimal . valueOf ( roundUp ( n . doubleValue ( ) , p ) ) , scale ) ; }
Returns a value rounded-up to p digits after decimal.
If p is negative, then the number is rounded to
places to the left of the decimal point. eg.
10.23 rounded to -1 will give: 20. If p is zero,
the returned value is rounded to the nearest integral
value.
<p>If n is negative, the resulting value is obtained
as the round-up value of absolute value of n multiplied
by the sign value of n (@see MathX.sign(double d)).
Thus, -0.2 rounded-up to p=0 will give -1 not 0.
<p>If n is NaN, returned value is NaN.
@param n
@param p
@return