软件包 | 描述 |
---|---|
java.math |
用于执行任意精度的整数运算提供的类(
BigInteger )和任意精度的小数运算(
BigDecimal )。
|
java.text |
提供用于处理独立于自然语言的方式处理文本、日期、数字和消息的类和接口。
|
Modifier and Type | Method and Description |
---|---|
RoundingMode |
MathContext.getRoundingMode()
返回roundingmode设置。
|
static RoundingMode |
RoundingMode.valueOf(int rm)
返回一个整数舍入模式的不断
BigDecimal 遗留在相应的
RoundingMode 对象。
|
static RoundingMode |
RoundingMode.valueOf(String name)
返回此类型具有指定名称的枚举常量。
|
static RoundingMode[] |
RoundingMode.values()
返回一个数组包含该枚举类型的常量,它们的顺序声明。
|
Modifier and Type | Method and Description |
---|---|
BigDecimal |
BigDecimal.divide(BigDecimal divisor, int scale, RoundingMode roundingMode)
返回的值是
BigDecimal
(this / divisor) ,其规模为指定的。
|
BigDecimal |
BigDecimal.divide(BigDecimal divisor, RoundingMode roundingMode)
返回的值是
BigDecimal
(this / divisor) ,其规模
this.scale() 。
|
BigDecimal |
BigDecimal.setScale(int newScale, RoundingMode roundingMode)
返回一个
BigDecimal 其规模是规定值,且不成比例的价值乘以或除以
BigDecimal 的缩放值十的合适的电源来维持其整体价值的确定。
|
Constructor and Description |
---|
MathContext(int setPrecision, RoundingMode setRoundingMode)
构建与指定的精度的一种新
MathContext 和舍入模式。
|
Modifier and Type | Method and Description |
---|---|
RoundingMode |
NumberFormat.getRoundingMode()
获取用于解析的
RoundingMode 。
|
RoundingMode |
DecimalFormat.getRoundingMode()
被采用的
RoundingMode DecimalFormat。
|
Modifier and Type | Method and Description |
---|---|
void |
NumberFormat.setRoundingMode(RoundingMode roundingMode)
集在这的
RoundingMode 解析。
|
void |
DecimalFormat.setRoundingMode(RoundingMode roundingMode)
集在这的
RoundingMode DecimalFormat。
|
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.