Can JSTL fmt:formatNumber be used to get this output: “1 234.56”?

后端 未结 1 1025
轻奢々
轻奢々 2021-01-12 18:44

I\'m trying to get numbers formatted in this specific format:

\"1 234.56\"

So, two decimals, separated by a dot. And grouping thousands with a space char (op

1条回答
  •  迷失自我
    2021-01-12 19:16

    Here is one way.

    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
     
     
    ${fn:replace(pat, ",", " ")}
    

    0 讨论(0)
提交回复
热议问题