提交 2e1828c0 编写于 作者: M mchung

6355704: (fmt) %f formatting of BigDecimals is incorrect

Reviewed-by: darcy
Contributed-by: brian.burkhalter@oracle.com
上级 71429eee
......@@ -1103,6 +1103,15 @@ public class Basic$Type$ extends Basic {
test("%.5f", "1.99999", val);
test("%.6f", "1.999990", val);
val = new BigDecimal(0.9996);
test("%.0f", "1", val);
test("%.1f", "1.0", val);
test("%.2f", "1.00", val);
test("%.3f", "1.000", val);
test("%.4f", "0.9996", val);
test("%.5f", "0.99960", val);
test("%.6f", "0.999600", val);
#end[BigDecimal]
#if[float]
......
......@@ -1102,6 +1102,15 @@ public class BasicBigDecimal extends Basic {
test("%.4f", "2.0000", val);
test("%.5f", "1.99999", val);
test("%.6f", "1.999990", val);
val = new BigDecimal(0.9996);
test("%.0f", "1", val);
test("%.1f", "1.0", val);
test("%.2f", "1.00", val);
test("%.3f", "1.000", val);
test("%.4f", "0.9996", val);
test("%.5f", "0.99960", val);
test("%.6f", "0.999600", val);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册