简体   繁体   中英

SSRS How do i force number to two decimal numbers if it is not 0?

If the number has value force it to 0.00 format if it is 0 just display as 0.

I have tried rounding (shows up as an error) and the text boxes are set to number and it still has a continuous number.

For example:

fields.day12.value = 0 display as 0 BUT if it is fields.day12.value = 12.45555555555 display as 12.45

Unless they are specified, the text boxes' FORMAT property will apply the same format regardless of how many digits are needed or the number is negative or zero.

To use different formatting for negative numbers or zero, the FORMAT property can be used with a custom number format that specifies the negative and zero formats.

+#,##0.0;-#,##0.0;0.0

The first part before the semicolon is for the positive values, the second for negative, and then zero.

For the format required, you could use

0.00;-0.00;0

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM