Commit 680f4f66 authored by hongguangwu's avatar hongguangwu

MVP1.7.11-见分进元

parent 98a18d6b
...@@ -492,7 +492,6 @@ public class Common { ...@@ -492,7 +492,6 @@ public class Common {
* @Date 2019-09-26 * @Date 2019-09-26
**/ **/
public static BigDecimal formatMoneyForFund(BigDecimal money, int type) { public static BigDecimal formatMoneyForFund(BigDecimal money, int type) {
DecimalFormat formater = new DecimalFormat("#0.#");
if (type == 1) {//四舍五入取整 if (type == 1) {//四舍五入取整
return BigDecimal.valueOf(money.doubleValue()).setScale(0, RoundingMode.HALF_UP); return BigDecimal.valueOf(money.doubleValue()).setScale(0, RoundingMode.HALF_UP);
} }
...@@ -508,6 +507,11 @@ public class Common { ...@@ -508,6 +507,11 @@ public class Common {
if (type == 5) {//保留一位小数 if (type == 5) {//保留一位小数
return BigDecimal.valueOf(money.doubleValue()).setScale(1, RoundingMode.HALF_UP); return BigDecimal.valueOf(money.doubleValue()).setScale(1, RoundingMode.HALF_UP);
} }
if (type == 6) {//见分进元
return BigDecimal.valueOf(Math.ceil(BigDecimal.valueOf(money.doubleValue())
.setScale(2, RoundingMode.HALF_DOWN).doubleValue()))
.setScale(0, BigDecimal.ROUND_UP);
}
return money; return money;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment