Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
499 views
in Technique[技术] by (71.8m points)

service - SSRS expression to format two decimal places does not show zeros

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...