0

I've found multiple ways to format a rounded number, but what I am looking for is how to tell which way a number is rounded, specifically in SSRS 2014:

=IIF(Round(Fields!IMPERVIOUS_AREA.Value/4000,2,MidpointRounding.AwayFromZero)=Floor(0),"Round Up","Round Down")

I would like to see in my results 5.73 to be "Rounded Up" and 2.09 to be "Rounded Down", but all I keep getting is "Rounded Down". I've tried putting =Ceiling(0) and =Floor(0) in my statement, hoping it could evaluate true or false.

honk
  • 9,137
  • 11
  • 75
  • 83
ltbehling
  • 3
  • 2

2 Answers2

2

Ceiling(value) always rounds up to the nearest integer. Round(value) decides which way to round based on the common rules.

So it follows that testing if Ceiling(value) = Round(value) will tell you whether the value was rounded up.

=IIF(Ceiling(value) = Floor(value), "Value was already an integer.", IIF(Ceiling(value) = Round(value), "Value was Rounded Up.", "Value was Rounded Down."))
JC Ford
  • 6,946
  • 3
  • 25
  • 34
0

You can compare rounded and not rounded value. That allows you to see the direction of the movement:

=IIF(Round(value) > value, 
    "Rounded Up",
    IIF(Round(value) < value, 
        "Rounded Down", 
        "No rounding"))
PiotrWolkowski
  • 8,408
  • 6
  • 48
  • 68