Java Decimal Round roundDouble(double iVal)

Here you can find the source of roundDouble(double iVal)

Description

round Double

License

Apache License

Declaration

public static double roundDouble(double iVal) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.text.DecimalFormat;

public class Main {
    public static double roundDouble(double iVal) {
        DecimalFormat df = new DecimalFormat(".0");
        String tmp = df.format(iVal);
        return Double.parseDouble(tmp);
    }/* w  w w .j a  v a 2 s. c  o  m*/
}

Related

  1. roundAndTruncate(double rawValue, int precision)
  2. roundDecimal(double d, int radix)
  3. roundDecimalPlaces(final double input, final int decimalPlaces)
  4. roundDecimals(double d, int numOfDec)
  5. roundDistanceFromMeterToKm(final double distanceInMeter)
  6. roundDouble(double num, int decimal)
  7. roundDouble(double numero, int ceros_a_la_derecha)
  8. roundDouble(Double val, int precision)
  9. roundedNumber(double inVal)