【发布时间】:2023-04-06 12:58:02
【问题描述】:
在 jstl 货币中使用 http://java.sun.com/jsp/jstl/fmt。
标签包括如下:
我们正在使用
<fmt:formatNumber maxFractionDigits="0" currencySymbol="$" type="currency" value="${employeeDetail.employee.annualSalary }" />
Now behavior is :
Ex: $470.161 is round to $470.16)
Ex: $470.165 is round to $470.16)
Ex: $470.166 is round to $470.17)
what is expected uis
Ex: $470.161 is round to $470.16)
Ex: $470.165 is round to $470.17)
Ex: $470.166 is round to $470.17)
有什么方法可以设置圆形RoundingMode.HALF_UP?
任何覆盖 [jstl fmt 标签库] 的默认行为并支持舍入模式的方法。
【问题讨论】: