public interface RoundingStrategy
Quantity
uses
classes implementing RoundingStrategy
to facilitate arithmetic operations.Modifier and Type | Field and Description |
---|---|
static RoundingStrategy |
MONETARY_ROUNDING
Convenience instance, which can be used for monetary rounding.
|
static RoundingStrategy |
ROUND_ONE
Convenience instance, which can be used for rounding of integral types.
|
Modifier and Type | Method and Description |
---|---|
BigDecimal |
round(BigDecimal amount)
Rounds the given
BigDecimal instance amount with a specific strategy. |
static final RoundingStrategy MONETARY_ROUNDING
static final RoundingStrategy ROUND_ONE
BigDecimal round(BigDecimal amount)
BigDecimal
instance amount
with a specific strategy. Because BigDecimal
is
immutable, a new instance with a rounded value is returned.amount
- The BigDecimal
instance which should be rounded.BigDecimal
instance which has a rounded value.Copyright © 2014 Pivotal Software, Inc.. All rights reserved.