Search code examples
reporting-servicesssrs-2014

SSRS report builder 2014 CDbl precision


I have some column in my report, calculated the Sum using this exepression :

=SUM(IIF(Fields!Type.Value = 0, CDbl(Fields!Amount.Value), CDbl(0.0)))

it works but gives me the sum with no precision. is there a way I can view the Sum with precision?

UPDATE

the Fields!Amount.Value is alway decimal(18, 3)
If The calculation was like sum = 10 + 10 the result becomes 20
if sum = 10 + 2.125 the result becomes 12.125

I want the result to be converted to (18, 3).
so I expect the result in the first example to be 20.000


Solution

  • Your report is correctly returning the values to the necessary precision, it is just only showing the significant figures because you have not told it what number formatting you require and is making a best guess.

    If you change your expression to the below, you should get your desired output:

    =FORMAT(SUM(IIF(Fields!Type.Value = 0, CDbl(Fields!Amount.Value), CDbl(0.0))),"0.000")