The list of methods to do BigDecimal Normalize are organized into topic(s).
int
normalizePrecision(String precision, BigDecimal... decimals) Returns the specified precision unless it is null, in which case the maximum precision from the list of decimals is returned.
int result;
if (precision != null) {
result = Integer.parseInt(precision);
} else {
result = getMaxPrecision(decimals);
return result;
BigDecimal
normalizeScale(BigDecimal bigDecimal) Normalizes the scale of bigDecimal to 2 decimal places and RoundingMode#HALF_UP .
return bigDecimal == null ? null : bigDecimal.setScale(2, HALF_UP);