📜  将比例设置为大十进制java代码示例

📅  最后修改于: 2022-03-11 14:52:49.607000             🧑  作者: Mango

代码示例1
// 1.
new BigDecimal("35.3456").round(new MathContext(4, RoundingMode.HALF_UP));
//result = 35.35
// 2.
new BigDecimal("35.3456").setScale(4, RoundingMode.HALF_UP);
// result = 35.3456