提交 33c1102b 编写于 作者: M mduigou

Merge

...@@ -1401,10 +1401,9 @@ import sun.misc.FormattedFloatingDecimal; ...@@ -1401,10 +1401,9 @@ import sun.misc.FormattedFloatingDecimal;
* <p> The number of digits in the result for the fractional part of * <p> The number of digits in the result for the fractional part of
* <i>m</i> or <i>a</i> is equal to the precision. If the precision is not * <i>m</i> or <i>a</i> is equal to the precision. If the precision is not
* specified then the default value is {@code 6}. If the precision is * specified then the default value is {@code 6}. If the precision is
* less than the number of digits which would appear after the decimal * less than the number of digits to the right of the decimal point then
* point in the string returned by {@link Float#toString(float)} or {@link * the value will be rounded using the
* Double#toString(double)} respectively, then the value will be rounded * {@linkplain java.math.BigDecimal#ROUND_HALF_UP round half up
* using the {@linkplain java.math.BigDecimal#ROUND_HALF_UP round half up
* algorithm}. Otherwise, zeros may be appended to reach the precision. * algorithm}. Otherwise, zeros may be appended to reach the precision.
* For a canonical representation of the value, use {@link * For a canonical representation of the value, use {@link
* BigDecimal#toString()}. * BigDecimal#toString()}.
...@@ -1465,10 +1464,9 @@ import sun.misc.FormattedFloatingDecimal; ...@@ -1465,10 +1464,9 @@ import sun.misc.FormattedFloatingDecimal;
* <p> The number of digits in the result for the fractional part of * <p> The number of digits in the result for the fractional part of
* <i>m</i> or <i>a</i> is equal to the precision. If the precision is not * <i>m</i> or <i>a</i> is equal to the precision. If the precision is not
* specified then the default value is {@code 6}. If the precision is * specified then the default value is {@code 6}. If the precision is
* less than the number of digits which would appear after the decimal * less than the number of digits to the right of the decimal point
* point in the string returned by {@link Float#toString(float)} or {@link * then the value will be rounded using the
* Double#toString(double)} respectively, then the value will be rounded * {@linkplain java.math.BigDecimal#ROUND_HALF_UP round half up
* using the {@linkplain java.math.BigDecimal#ROUND_HALF_UP round half up
* algorithm}. Otherwise, zeros may be appended to reach the precision. * algorithm}. Otherwise, zeros may be appended to reach the precision.
* For a canonical representation of the value, use {@link * For a canonical representation of the value, use {@link
* BigDecimal#toString()}. * BigDecimal#toString()}.
...@@ -3585,7 +3583,7 @@ public final class Formatter implements Closeable, Flushable { ...@@ -3585,7 +3583,7 @@ public final class Formatter implements Closeable, Flushable {
int scale = value.scale(); int scale = value.scale();
if (scale > prec) { if (scale > prec) {
// more "scale" digits than the requested "precision // more "scale" digits than the requested "precision"
int compPrec = value.precision(); int compPrec = value.precision();
if (compPrec <= scale) { if (compPrec <= scale) {
// case of 0.xxxxxx // case of 0.xxxxxx
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册