Android Double Round round(double number, int decimal)

Here you can find the source of round(double number, int decimal)

Description

round

Declaration

public static BigDecimal round(double number, int decimal) 

Method Source Code

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

public class Main {

    public static BigDecimal round(double number, int decimal) {
        return new BigDecimal(number).setScale(decimal,
                BigDecimal.ROUND_HALF_UP);
    }// ww w .ja  v  a 2 s.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)
  5. roundTwoDecimals(double d)
  6. convertDecimal(double d)
  7. twoDecimalDoubleFormatter(double number)