1

In RDLC, One of the column output is 2.099. I want it as 2.09. I've already used Format and FormatNumber Function in RDLC expression. But the output is 2.10. But I need 2.09. How??

I have tried in these ways:

=FormatNumber (Sum(Switch((Fields!IsConsiderGPA.Value) = True , (Fields!Credit.Value) * (Fields!GPA.Value) )) / Sum(Switch(Fields!IsConsiderGPA.Value = True , (Fields!Credit.Value))),2)

=Format (Sum(Switch((Fields!IsConsiderGPA.Value) = True , (Fields!Credit.Value) * (Fields!GPA.Value) )) / Sum(Switch(Fields!IsConsiderGPA.Value = True , (Fields!Credit.Value))),"N")

=Format (Sum(Switch((Fields!IsConsiderGPA.Value) = True , (Fields!Credit.Value) * (Fields!GPA.Value) )) / Sum(Switch(Fields!IsConsiderGPA.Value = True , (Fields!Credit.Value))),"D")

And also changed the Number type in Text box properties. But failed.....

2 Answers2

2

Use Math.Trucate in your expression, ex:

=Math.Truncate(Sum(Switch((Fields!IsConsiderGPA.Value) = True , (Fields!Credit.Value) * (Fields!GPA.Value) )) / Sum(Switch(Fields!IsConsiderGPA.Value = True , (Fields!Credit.Value))))*100)/100

You can then format the number as you with in the "Number" vertical tab in the text box properties.

Carlos Ferreira
  • 432
  • 5
  • 15
  • [Here](http://stackoverflow.com/a/39305134/2218697) is my answer to set 3 decimal places without rounding off , is that correct ? – Shaiju T Sep 03 '16 at 09:03
0

create following custom function under "Report Properties", in code tab:

    Public Function WithoutRound(vl As String)

        Dim temp As String

        temp = FormatNumber(vl, 4)

        temp = Left(temp, Len(temp) - 2)

        Return temp

    End Function

and use it in textbox like

=Code.WithoutRound(Fields!RunningBalance.Value)