SSRS rounds to whole numbers, but includes 2 decimal places

14.9k Views Asked by At

I have some SQL, of which the part in question is:

sum(Minutes)/60.0 Hrs

In SQL Server Management Studio, my database returns:

14.500000

In SSRS, my report displays:

14.00

My RDL's cell that displays this value has this definition:

=Fields!Hrs.Value

The cell's textbox properties have been defined as a Number, no checkboxes selected, 2 decimal points.

So, the question is, why is my report only outputting 14.00 rather than 14.50 and how can I fix it?

Edit: It may be worth mentioning that the cell data is strangely left-justified, despite not having told it to justify.

3

There are 3 best solutions below

2
On

Try changing its definition to this:

=Format(CDbl(Fields!myFields.Value),"00.00")
0
On

I think you are using CInt instead of CDbl which will always try to return an integer. Hence the .00 at the end of your expression. Try:

=Format(CDbl(Fields!myFields.Value),"F2")
0
On

If you edit the textbox properties of the cell, and after selecting the type number, you change decimals two zero it should work regardless of the content of the cell. Like this: enter image description here