Click here to Skip to main content
15,887,998 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
In the ssrs Reports,
the output for round(417.504,2) is giving 417.51

is there any function or option to get the my desired Rounding value

i want it to be round(417.504,2)=417.50

Thank You..
Posted

Use the following in your code:

Round(417.504, 2, MidpointRounding.AwayFromZero)
 
Share this answer
 
Comments
Sujith Karivelil 30-Jan-15 0:43am    
What is Round() method is it user defined function? then include that coding also to make sense
Gideon van Dyk 30-Jan-15 0:44am    
Part of the built-in SSRS report functions.
For rounding you can use any of the following method:

VB
Dim n As Double = 417.506 '<-- input number
Dim a = Math.Round(n, 2) ' <--- will gives 417.51
Dim b = Math.Truncate(n * 100) / 100 ' <--- will gives 417.5
Dim c As Integer = Math.Ceiling(n) ' <--- will gives 418
Dim d = n.ToString("N2") ' <--- will gives 417.50
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900