jsp page scientific notation display solutions to problems

Double type value returned in the JSP page, if the value is too large, it will be displayed as scientific notation.

This problem usually occurs in the input form to fill in, and therefore must be addressed.

JSTL provides a standard numeric formatting tags, use is very simple.

value="<fmt:formatNumber value='${contract.contMoney}' pattern='#.##' />"

This perfectly solves the problem, you do not need to modify the code in the background, almost the most simple solution.

If an error or does not take effect, attention must first import JSTL dependence.

 

"I do not want anything, I want you."

Guess you like

Origin www.cnblogs.com/yanggb/p/11528479.html