Uses of Enum Class
java.math.RoundingMode
Packages that useRoundingMode
Package
Description
Provides classes for performing arbitrary-precision integer arithmetic (
BigInteger) and arbitrary-precision decimal arithmetic (BigDecimal).Provides classes and interfaces for handling text, dates, numbers, and messages in a manner independent of natural languages.
Uses ofRoundingMode injava.math
Subclasses with type arguments of typeRoundingMode injava.mathModifier and TypeClassDescriptionenumSpecifies arounding policy for numerical operations capable of discarding precision.Methods injava.math that returnRoundingModeModifier and TypeMethodDescriptionMathContext.getRoundingMode()Returns the roundingMode setting.staticRoundingModeRoundingMode.valueOf(int rm) Returns theRoundingModeobject corresponding to a legacy integer rounding mode constant inBigDecimal.staticRoundingModeReturns the enum constant of this class with the specified name.staticRoundingMode[]RoundingMode.values()Returns an array containing the constants of this enum class, inthe order they are declared.Methods injava.math with parameters of typeRoundingModeModifier and TypeMethodDescriptionBigDecimal.divide(BigDecimal divisor, int scale,RoundingMode roundingMode) Returns aBigDecimalwhose value is(this / divisor), and whose scale is as specified.BigDecimal.divide(BigDecimal divisor,RoundingMode roundingMode) Returns aBigDecimalwhose value is(this / divisor), and whose scale isthis.scale().BigDecimal.setScale(int newScale,RoundingMode roundingMode) Returns aBigDecimalwhose scale is the specified value, and whose unscaled value is determined by multiplying or dividing thisBigDecimal's unscaled value by the appropriate power of ten to maintain its overall value.Constructors injava.math with parameters of typeRoundingModeModifierConstructorDescriptionMathContext(int setPrecision,RoundingMode setRoundingMode) Constructs a newMathContextwith a specified precision and rounding mode.Uses ofRoundingMode injava.text
Methods injava.text that returnRoundingModeModifier and TypeMethodDescriptionCompactNumberFormat.getRoundingMode()Gets theRoundingModeused in thisCompactNumberFormat.DecimalFormat.getRoundingMode()Gets theRoundingModeused in this DecimalFormat.NumberFormat.getRoundingMode()Gets theRoundingModeused in this NumberFormat.Methods injava.text with parameters of typeRoundingModeModifier and TypeMethodDescriptionvoidCompactNumberFormat.setRoundingMode(RoundingMode roundingMode) Sets theRoundingModeused in thisCompactNumberFormat.voidDecimalFormat.setRoundingMode(RoundingMode roundingMode) Sets theRoundingModeused in this DecimalFormat.voidNumberFormat.setRoundingMode(RoundingMode roundingMode) Sets theRoundingModeused in this NumberFormat.