Android Double Round round(double d, int decimalPlace)

Here you can find the source of round(double d, int decimalPlace)

Description

round

Declaration

public static String round(double d, int decimalPlace) 

Method Source Code

//package com.java2s;
import java.text.DecimalFormat;

public class Main {
    public static String round(double d, int decimalPlace) {
        DecimalFormat df = new DecimalFormat();
        df.setMaximumFractionDigits(decimalPlace);
        df.setMinimumFractionDigits(decimalPlace);
        return df.format(d);
    }// w  w  w . ja  v  a  2s .  c o m
}

Related

  1. round(double value)
  2. round(double d, int decimalPlace)
  3. round(double val, int numberOfDigitsAfterDecimal)
  4. round(double what, int howmuch)