Java BigDecimal Create getDecimal(double a)

Here you can find the source of getDecimal(double a)

Description

get Decimal

License

Open Source License

Declaration

public static double getDecimal(double a) 

Method Source Code

//package com.java2s;
// LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING,

import java.math.BigDecimal;

public class Main {

    public static double getDecimal(double a) {
        BigDecimal bd = new BigDecimal(a);
        bd = bd.setScale(3, BigDecimal.ROUND_HALF_UP);
        return bd.doubleValue();
    }/*from w  w  w  .j  av a 2 s .  c o  m*/
}

Related

  1. getBigDecimalFrom(double value)
  2. getBigDecimalFromByteArray(byte[] bytes, int start, int length, int scale)
  3. getBigDecimalFromPrimitiveTypes(int input, int scale, int precision)
  4. getBigDecimalOrNull(Object value)
  5. getBigDecimalValue(Object o)
  6. getDecimal(Object[] data, int ordinal)
  7. getDecimal(String clusive, int[] currentDecimal)
  8. getDecimal(String number, BigDecimal def)
  9. getDecimalCoords(Integer degrees, Integer minutes, Integer seconds)