Java Number Round roundNumber(double theNumber, int places)

Here you can find the source of roundNumber(double theNumber, int places)

Description

round Number

License

Open Source License

Declaration

public static double roundNumber(double theNumber, int places) 

Method Source Code

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

public class Main {
    public static double roundNumber(double theNumber, int places) {
        double placesDouble = Math.pow(10, places);
        return Math.round(theNumber * placesDouble) / placesDouble;
    }/*w w  w. ja v a2  s  .co  m*/
}

Related

  1. roundMinAndMax(double min, double max, int tickCount)
  2. roundMultiplier(double n)
  3. roundNearest(double v, double target)
  4. roundNicely(double dbl)
  5. roundNumber(double rowNumber, int roundingPoint)
  6. roundNumber(float input, float rounding)
  7. roundNumber(String n)
  8. roundNumberTo(double value, int decimals)
  9. roundNumberToDouble(double value, int decimals)