SSRS expression to format two decimal places does not show zeros

Abe picture Abe · Jan 17, 2014 · Viewed 156.2k times · Source

I am using the following expression to format my value to show only two decimal points. Which Works fine if the value is not 0. However when the value is 0 it does not show 0.

eg. Expression used

=Format(Fields!CUL1.Value, "##.##")

If CUL1.Value is 2.5670909 the value shown in the report 2.56 (this is brilliant!) If CUL1.Value is 0.006709 no value is shown (I would like it to show 0.00) If CUL1.Value is 0 no value is shown ( I would like to show 0)

Thanks.

Answer

Spegah picture Spegah · Jul 23, 2014

If you want it as a string use:

=Format(Fields!CUL1.Value, "F2")

As a number use:

=FormatNumber(Fields!CUL1.Value, 2)

This will ensure it exports out to excel correctly as a number.