Format the data output by Bean: Write. In our struts application, if Bean: Write outputs a large double data, it will be represented in scientific notation by default, such as 1.20.e8.
We need to format it, for example, the kilobytes. That is, the output is 13,160,000.00.
For some phenomena, we use the format attribute of Bean: write, that is, format = "0,000.00"
If this is common, you can set Org. apache. struts. taglib. bean. format. float = 0,000.00. Of course, the format attribute takes priority in actual processing. That is to say, if the format attribute exists, Bean: Write will format it with the format attribute value. Otherwise, format it with the default org. Apache. Struts. taglib. Bean. format. Float value.
Such formatting parameters include:
?
Serial number |
Format parameters |
Applicable type |
1 |
Org. Apache. Struts. taglib. Bean. format. SQL. Timestamp |
Java. SQL. Timestamp |
2 |
Org. Apache. Struts. taglib. Bean. format. SQL. Date |
Java. SQL. Date |
3 |
Org. Apache. Struts. taglib. Bean. format. SQL. Time |
Java. SQL. Time |
4 |
Org. Apache. Struts. taglib. Bean. format. Date |
Java. util. Date |
5 |
Org.apache.struts.taglib.bean.format.int |
Byte, short, integer, long, biginteger |
6 |
Org. Apache. Struts. taglib. Bean. format. Float |
Float, double, bigdecimal |