Here you can find the source of getScale(BigDecimal bd1, BigDecimal bd2)
private static int getScale(BigDecimal bd1, BigDecimal bd2)
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; public class Main { private static int getScale(BigDecimal bd1, BigDecimal bd2) { int scale1 = 0; int scale2 = 0; if (bd1 != null) { scale1 = bd1.scale();//ww w . j a v a2 s.c om } if (bd2 != null) { scale2 = bd2.scale(); } return (scale1 > scale2 ? scale1 : scale2); } }