com.evanmclean.evlib.misc
Class Round

java.lang.Object
  extended by com.evanmclean.evlib.misc.Round

public final class Round
extends Object

Round a double to a specified number of decimal places.

Author:
Evan McLean McLean Computer Services (see the overview for copyright and licensing.)

Method Summary
static double round(double val, int places)
          Round the value to the specified number of decimal places.
static double two(double val)
          Round the value to two decimal places.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

round

public static double round(double val,
                           int places)
Round the value to the specified number of decimal places.

Parameters:
val - The value to round.
places - The number of decimal places.
Returns:
The rounded value.

two

public static double two(double val)
Round the value to two decimal places.

Parameters:
val - The value to round.
Returns:
The value rounded to two decimal places.