Precision of Float settings in rdlc reports-decimal places

Source: Internet
Author: User

1. Round () function

The parameter of this function must be of the floating point type. Therefore, the format must be converted first. If it is null, the conversion will fail. When the column is empty, the value 0.00 is displayed. This is not easy to understand.

2. formatnumber () function

The format of this function is 123,456,567.00. "," Is added to the data. Not nice.

The above two functions are combined with expressions and bound to fields. For example:

= Formatnumber (sum (cdbl (Fields! Usage. Value )))

= Round (sum (cdbl (Fields! Usage. Value )))

3. Set attributes of the rdlc text box

The third method is that I recommend a good one.

For example, select the text box attribute --- format --- number

Select a format. By default, if F is displayed above, two decimal places are reserved. You can also write F3 to display three decimal places. F2 indicates two decimal places. You can use NotePad to open the rdlc file.CodeYou will be surprised to find that the formatting and field are written separately. <Format> F </format>. Therefore, you can exclude many exceptions, such as null.

Share from http://hi.baidu.com/ren_long _/

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.