Java BigDecimal getDoubleBigDecimal(String amount, int afterDot)

Here you can find the source of getDoubleBigDecimal(String amount, int afterDot)

Description

get Double Big Decimal

License

Open Source License

Declaration

public static double getDoubleBigDecimal(String amount, int afterDot) 

Method Source Code


//package com.java2s;
import java.math.BigDecimal;

public class Main {
    public static double getDoubleBigDecimal(String amount, int afterDot) {
        double result = 0;
        BigDecimal bigDecimal = new BigDecimal(amount);
        result = bigDecimal.setScale(afterDot, BigDecimal.ROUND_HALF_EVEN).doubleValue();
        return result;
    }//from  w  w  w.  j  a v a2  s  .  c o  m
}

Related

  1. getDateFromRank(BigDecimal rank)
  2. getDepositAmount(Boolean isReceipt, BigDecimal amount)
  3. getDigits(BigDecimal value)
  4. getDistance(BigDecimal sourceLatitude, BigDecimal sourceLongitude, BigDecimal destLatitude, BigDecimal destLongitude)
  5. getDividedBigDecimal(final int nDividend, final int nDivisor)
  6. getEndTimeByManDay(Date serviceStartTime, BigDecimal manDay)
  7. getFloatingPoint(Console console, Function validator)
  8. getFormattedBigDecimal(BigDecimal value)
  9. getFraction(BigDecimal b)