Jsp page scientific notation display problem solution

The value of double type returned in the JSP page, if the value is too large, will be displayed in scientific notation.

This problem usually occurs in the input of form filling, so it must be solved.

JSTL provides standard numeric formatting tags, which are very simple to use.

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

This solves the problem perfectly, and does not need to modify the code in the background, which is almost the simplest solution.

If an error is reported or it does not take effect, be careful to import the dependencies of JSTL first.

 

"I don't want anything, I just want you."

Reprinted in: https://www.cnblogs.com/yanggb/p/11528479.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324813849&siteId=291194637