Android Double Round roundTwoDecimals(double d)

Here you can find the source of roundTwoDecimals(double d)

Description

round Two Decimals

Declaration

public static double roundTwoDecimals(double d) 

Method Source Code

//package com.java2s;

import java.text.DecimalFormat;

public class Main {
    public static double roundTwoDecimals(double d) {
        DecimalFormat twoDForm = new DecimalFormat("#.##");
        return Double.valueOf(twoDForm.format(d));
    }/*from  w  w  w  .jav  a 2 s.c om*/
}

Related

  1. round(double d, int decimalPlace)
  2. round(double value)
  3. round(double d, int decimalPlace)
  4. round(double val, int numberOfDigitsAfterDecimal)
  5. round(double what, int howmuch)
  6. round(double number, int decimal)
  7. convertDecimal(double d)
  8. twoDecimalDoubleFormatter(double number)