BEAN: Write 4 format the output data

Source: Internet
Author: User

 

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.