Java Double Number Round roundDec(float num, int dec)

Here you can find the source of roundDec(float num, int dec)

Description

round Dec

License

Open Source License

Declaration

private static float roundDec(float num, int dec) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    private static float roundDec(float num, int dec) {
        return (float) Math.round(num * (10 ^ dec)) / (10 ^ dec);
    }/*from w  w  w . j ava2s.  c  o m*/
}

Related

  1. roundAngle(double a, long n)
  2. roundAtDecimals(double number, int deci)
  3. roundAway(double d)
  4. roundAwayFromZero(double num)
  5. roundBig(double d)
  6. roundDecimal(Double value)
  7. roundDecimal(double x, int d)
  8. roundDecimals(double d, int decimalPlaces)
  9. roundDecimals(double x, int decimals)