The SSRS Round function is a Mathematical function that will round the double-precision floating-point number to the nearest integer value. The syntax of the Round function to return the nearest integer is as shown below.
The SSRS Round function accepts two arguments, the second one optional. The first argument is the floating-point number to round. The second argument is the number of decimals to keep. For instance, Round (15.789) returns 16, whereas Round (15.789, 2) returns 15.79. Anything below .50 will fall to the same number and above will fall to the next number.
=Round(15.78976)
=Round(15.78976, 2)
To demonstrate the SSRS Round function, we use the Products table below, which has 14 records. The image shows the records in the table report; the result is in an empty column.
SSRS Round function Example
To do this, right-click the textbox under the Result Header and choose the Expression to open the window below. The Round function below will return the nearest integer value of the SalesAmount column without any decimals.
=Round(Fields!SalesAmount.Value)
Similarly, let me create five more columns to the right of the Result and name them Dec 1, Dec 2, Dec 3, and Away 0, and even demonstrate all possible options. The below SSRS Round function expression rounds the decimal values. If the second argument value is 1, it rounds to a single decimal; 2 means 2 decimals, and 3 means 3 decimal precision.
=Round(Fields!SalesAmount.Value, 1)
=Round(Fields!SalesAmount.Value, 2)
=Round(Fields!SalesAmount.Value, 3)
We have also used the other two options available to show them in real-case scenarios.
=Round(Fields!SalesAmount.Value, System.MidpointRounding.AwayFromZero)
=Round(Fields!SalesAmount.Value, System.MidpointRounding.ToEven)
Please click the preview tab to see the Round function report.