Java BigDecimal getScaledDouble(BigDecimal input)

Here you can find the source of getScaledDouble(BigDecimal input)

Description

get Scaled Double

License

Open Source License

Declaration

public static double getScaledDouble(BigDecimal input) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.math.BigDecimal;

public class Main {
    private static final int SCALE = 2;
    private static final int ROUNDING_MODE = BigDecimal.ROUND_HALF_UP;

    public static double getScaledDouble(BigDecimal input) {
        double retVal = 0;

        if (input != null) {
            retVal = input.setScale(SCALE, ROUNDING_MODE).doubleValue();
        }//from  w w w .j  a  v a 2s .  c  o  m

        return retVal;
    }
}

Related

  1. getRandomBigDecimal(int maxValue, int scale)
  2. getRandomPriceChangeFactor(BigDecimal currentPrice)
  3. getRecordSize(List> columnBaseData)
  4. getRSBigDecimal(Object object)
  5. getScale(BigDecimal bd1, BigDecimal bd2)
  6. getSid(BigDecimal total, AtomicLong sid)
  7. getSignedBalance(BigDecimal balance)
  8. getTensVal(BigDecimal val)
  9. getTotalSum(List subTotals)