Labels are used to format numbers, percentages, and currencies.
- If the type attribute is a percentage or a number, you can use more than one number format property. The Maxintegerdigits and Minintegerdigits properties allow you to specify the size of the non-fractional portion of a number. If the actual number exceeds maxintegerdigits, the number is truncated.
- Properties are also provided to allow you to determine how many decimal digits should be used. The Minfractionaldigits and Maxfractionaldigits properties allow you to specify the number of decimal digits. If the number exceeds the maximum number of decimal digits, the number is rounded.
- Grouping can be used to insert commas between thousands of groups. Specify the grouping by setting the Groupingisused property to True or false. When using grouping with minintegerdigits, you must be careful to obtain the expected results.
- You can choose to use the Pattern property. This property allows you to include special characters that specify your numbering encoding. The following table lists the code:
# # example # #
Files: fmt_formatnumber.jsp-
<ul class= "List-group list-group-unbordered" > <li class= "List-group-item" > &L t;b> account balance </b> <a class= "pull-right" >¥<fmt:formatnumber value= "${rpaccount.availablebalance}" Pattern= "0.00"/></a> </li> <li class= "List-group-item" > <b> settled balances </b> <a class= "pull-right" >¥<fmt:formatnumber value= "${rpaccount.availablesettamount } "pattern=" 0.00 "/></a> </li> <li class=" List-group-item "> <b> Frozen amount </b> <a class= "pull-right" >¥<fmt:formatnumber value= "${rpaccount.unbalance}" pattern= " 0.00 "/></a> </li> <li class=" List-group-item "> <b& gt; today's earnings </b> <a class= "pull-right" >¥<fmt:formatnumber value= "${rpaccount.todayincome}" pattern= "0.00 "/></a> </li> <li class= "List-group-item" > <b> today's expenses </b> <a class= "Pull-right" >¥<f Mt:formatnumber value= "${rpaccount.todayexpend}" pattern= "0.00"/></a> </li> & Lt;/ul>
Jstl <fmt:formatNumber> Tags