Java BigDecimal getScale(BigDecimal bd1, BigDecimal bd2)

Here you can find the source of getScale(BigDecimal bd1, BigDecimal bd2)

Description

get Scale

License

Open Source License

Declaration

private static int getScale(BigDecimal bd1, BigDecimal bd2) 

Method Source Code


//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);
    }
}

Related

  1. getRandomBigDecimal(BigDecimal a, BigDecimal b)
  2. getRandomBigDecimal(int maxValue, int scale)
  3. getRandomPriceChangeFactor(BigDecimal currentPrice)
  4. getRecordSize(List> columnBaseData)
  5. getRSBigDecimal(Object object)
  6. getScaledDouble(BigDecimal input)
  7. getSid(BigDecimal total, AtomicLong sid)
  8. getSignedBalance(BigDecimal balance)
  9. getTensVal(BigDecimal val)