Return type | Name and parameters |
---|---|
void
|
downto(Number to, Closure closure)
Iterates from this number down to the given number, inclusive, decrementing by one each time. |
Boolean
|
isAtLeast(String right)
Compare a BigDecimal to a String representing a number. |
Boolean
|
isAtLeast(BigDecimal right)
Compare a BigDecimal to another. |
Number
|
multiply(Double right)
Multiply a BigDecimal and a Double. |
Number
|
multiply(BigInteger right)
Multiply a BigDecimal and a BigInteger. |
Number
|
power(Integer exponent)
Power of a BigDecimal to an integer certain exponent. |
BigDecimal
|
round()
Round the value Note that this method differs from BigDecimal#round(java.math.MathContext) which specifies the digits to retain starting from the leftmost nonzero digit. |
BigDecimal
|
round(int precision)
Round the value Note that this method differs from BigDecimal#round(java.math.MathContext) which specifies the digits to retain starting from the leftmost nonzero digit. |
BigDecimal
|
trunc()
Truncate the value |
BigDecimal
|
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. |
abs
, and
, asBoolean
, asType
, bitwiseNegate
, compareTo
, compareTo
, div
, div
, downto
, intdiv
, intdiv
, isCase
, leftShift
, minus
, minus
, mod
, multiply
, multiply
, next
, or
, plus
, plus
, plus
, power
, previous
, rightShift
, rightShiftUnsigned
, step
, times
, toBigDecimal
, toBigInteger
, toDouble
, toFloat
, toInteger
, toLong
, unaryMinus
, unaryPlus
, upto
, xor
addShutdownHook
, any
, any
, asBoolean
, asType
, collect
, collect
, collect
, dump
, each
, eachMatch
, eachMatch
, eachWithIndex
, every
, every
, find
, find
, findAll
, findAll
, findIndexOf
, findIndexOf
, findIndexValues
, findIndexValues
, findLastIndexOf
, findLastIndexOf
, findResult
, findResult
, getAt
, getMetaClass
, getMetaPropertyValues
, getProperties
, grep
, grep
, hasProperty
, identity
, inject
, inject
, inspect
, invokeMethod
, is
, isCase
, iterator
, metaClass
, print
, print
, printf
, printf
, println
, println
, println
, putAt
, respondsTo
, respondsTo
, setMetaClass
, split
, sprintf
, sprintf
, stream
, tap
, toString
, use
, use
, use
, with
, with
, withCloseable
, withStream
, withTraits
Iterates from this number down to the given number, inclusive, decrementing by one each time. Each number is passed to the closure. Example:
10.5.downto(0) { println it }Prints numbers 10.5, 9.5 ... to 0.5.
to
- the end numberclosure
- the code to execute for each numberCompare a BigDecimal to a String representing a number.
A fluent api style alias for compareTo
.
right
- a String representing a numberCompare a BigDecimal to another.
A fluent api style alias for compareTo
.
right
- a BigDecimalMultiply a BigDecimal and a Double. Note: This method was added to enforce the Groovy rule of BigDecimal*Double == Double. Without this method, the multiply(BigDecimal) method in BigDecimal would respond and return a BigDecimal instead. Since BigDecimal is preferred over Number, the Number*Number method is not chosen as in older versions of Groovy.
right
- a DoubleMultiply a BigDecimal and a BigInteger. Note: This method was added to enforce the Groovy rule of BigDecimal*long == long. Without this method, the multiply(BigDecimal) method in BigDecimal would respond and return a BigDecimal instead. Since BigDecimal is preferred over Number, the Number*Number method is not chosen as in older versions of Groovy. BigInteger is the fallback for all integer types in Groovy
right
- a BigIntegerPower of a BigDecimal to an integer certain exponent. If the exponent is positive, call the BigDecimal.pow(int) method to maintain precision. Called by the '**' operator.
exponent
- an Integer exponentRound the value
Note that this method differs from BigDecimal#round(java.math.MathContext) which specifies the digits to retain starting from the leftmost nonzero digit. This method rounds the integral part to the nearest whole number.
Round the value
Note that this method differs from BigDecimal#round(java.math.MathContext) which specifies the digits to retain starting from the leftmost nonzero digit. This method operates on the fractional part of the number and the precision argument specifies the number of digits to the right of the decimal point to retain.
precision
- the number of decimal places to keepTruncate the value
Truncate the value
precision
- the number of decimal places to keep