You may have noticed that when dividing two numbers in Report Designer, you may occasionally get either an integer (whole number) or a real number (containing remainder as decimals) as an output.
In this article, we will further elaborate on its functionality and behavior.
In the below example, notice how the expression 10/2 would output 5 (Column A) while the expression 9/2 would output 4 and not 4.5 (Column B).
When performing numerical division with the '/' operator, you will always obtain an integer. If you would like to display the output as a real number, there are two methods to achieve it.
Method 1: Create column reference in the expression
-
Let’s assume that column C is an existing column with a value. (In the below example, we created and added a value to column C for demonstration purposes.)
-
Create another column (Column D) and write a division expression that uses the existing column (Column C).
Method 2: Use a formula in the expression
Write a division expression with functions (Column E).