Description:
This function rounds a number to a specified number of digits.
Syntax: ROUND(Number, Num_Digits)
Remarks
Example
The ROUND function can be used in any database where you want to calculate the rounded value for a number that has one or more decimal points. This function rounds the given value to the number of digits that are specified as the second parameter. The ROUND function thus generates the rounded number as the value and returns it as the result of the function. The ROUND function works differently for different parameters supplied to it, and therefore the result for a parameter is different depending on the number supplied to the function as the "num_digits" parameter.
=ROUND (2.15, 1) |
-Rounds 2.15 to one decimal place (2.2) |
=ROUND (2.149, 1) |
-Rounds 2.149 to one decimal place (2.1) |
=ROUND (-1.475, 2) |
-Rounds -1.475 to two decimal places (-1.48) |
=ROUND (21.5, -1) |
- Rounds 21.5 to one decimal place to the left of the decimal point (20) |
Let us take the example of a cube in PowerOLAP which requires data that is the rounded value for any given integer which originally has one or more decimal points. If in the same dimension in another member or in another dimension in another cube, you want to display the calculated ROUND value, then it is appropriate to use the ROUND function to calculate the ROUND value for the given parameter. In this case we can write a formula in the cube in PowerOLAP to calculate the ROUND value for a number with the help of this function and write this value to the another member that is supposed to holds the ROUND value or you can also do this for a different dimension in a different cube.
The formula above writes values into the "NumFunctionValuesData" cube to the "ROUND" member in the NumFunctionValues dimension (data is at the intersection with the MathValue member of the Version dimension). This is done by calculating the "ROUND" value for a given number based on the number parameter and the num_digits parameter supplied to the function.
The ROUND function takes these two parameters, simply calculates the rounded number value and the result is obtained by rounding the given number to the number of digits specified as the second parameter. Depending upon the num_digits parameter, the result of this function will change automatically. The formula above calculates a ROUND number from any number given as a parameter to the member "Number1" and the result is returned by rounding that number to "2" digits after the decimal point as specified by the second parameter. This resultant value is written to the ROUND member of the "NumFunctionValues" dimension.