Groovy JDK

java.lang
Class Double

Method Summary
double abs()
Get the absolute value
void downto(Number to, Closure closure)
Iterates from this number down to the given number, inclusive, decrementing by one each time.
long round()
Round the value
double round(int precision)
Round the value
double trunc()
Truncate the value
double trunc(int precision)
Truncate the value
void upto(Number to, Closure closure)
Iterates from this number up to the given number, inclusive, incrementing by one each time.
 
Method Detail

abs

public double abs()
 
Get the absolute value
Returns:
the absolute value of that Double
Since:
1.0

downto

public void downto(Number to, Closure closure)
 
Iterates from this number down to the given number, inclusive, decrementing by one each time.
Parameters:
to - the end number.
closure - the code to execute for each number.
Since:
1.0

round

public long round()
 
Round the value
Returns:
the rounded value of that Double
Since:
1.0

round

public double round(int precision)
 
Round the value
Parameters:
precision - the number of decimal places to keep.
Returns:
the Double rounded to the number of decimal places specified by precision
Since:
1.6.4

trunc

public double trunc()
 
Truncate the value
Returns:
the Double truncated to 0 decimal places (i.e. a synonym for floor)
Since:
1.6.4

trunc

public double trunc(int precision)
 
Truncate the value
Parameters:
precision - the number of decimal places to keep.
Returns:
the Double truncated to the number of decimal places specified by precision
Since:
1.6.4

upto

public void upto(Number to, Closure closure)
 
Iterates from this number up to the given number, inclusive, incrementing by one each time.
Parameters:
to - the end number.
closure - the code to execute for each number.
Since:
1.0

Groovy JDK