Here you can find the source of normalizeScale(BigDecimal bigDecimal)
public static BigDecimal normalizeScale(BigDecimal bigDecimal)
//package com.java2s; //License from project: Apache License import static java.math.RoundingMode.HALF_UP; import java.math.BigDecimal; public class Main { /**/*from w ww . j a v a2s . co m*/ * Normalizes the scale of {@code bigDecimal} to 2 decimal places and {@link RoundingMode#HALF_UP}. All {@link * BigDecimal}s within the application should be normalized via this method for consistency. */ public static BigDecimal normalizeScale(BigDecimal bigDecimal) { return bigDecimal == null ? null : bigDecimal.setScale(2, HALF_UP); } }