在 jstl 货币中使用http://java.sun.com/jsp/jstl/fmt。
标签包含如下:<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
我们使用 as
<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 标签库] 的默认行为并支持舍入模式的任何方式。