DEC(number, decimals)
Numeric. The value to adjust the number of decimal places for.
Numeric constant. The number of decimals to use in the return value.
Numeric.
You can use this function when you want to adjust decimal places in mathematical calculations, or when you want to round a result to a specified number of decimal places.
You may need to adjust the number of decimals in your data to achieve the required precision in your calculations because ACL uses fixed point arithmetic.
The function adjusts the number parameter value to the number of decimals specified in the decimals parameter. If number is an integer, the specified number of decimals is added to the end of number. If the number of decimals is being reduced, the number parameter is rounded.
If you want to round a value to the nearest whole number, use the ROUND( ) function.
Example | Return value |
---|---|
DEC(7, 2) |
7.00 |
DEC(7.5647, 3) |
7.565 The return value is rounded to the specified number of decimal places. |
Calculating daily interest
To calculate daily interest to six decimal places for a field called Annual_rate, you would specify:
DEC(Annual_rate, 6) / 365