round_return_rounded_number_.htm
Navigation: Language Reference > 13 - Built-in Functions >====== ROUND (return rounded number) ====== | |
ROUND(expression,order)
ROUND | Returns rounded value. |
expression | A numeric constant, variable, or expression. |
order | A numeric expression with a value equal to a power of ten, such as 1, 10, 100, 0.1, 0.001, etc. If the value is not an even power of ten, the next lowest power is used; 0.55 will use 0.1 and 155 will use 100. |
The ROUND procedure returns the value of an expression rounded to a power of ten. If the order is a LONG or DECIMAL Base Type, then rounding is performed as a BCD operation. Note that if you want to round a real number larger than 1³°, you should use ROUND(num,1.0e°), and not ROUND(num,1). The ROUND procedure is very efficient (“cheap”) as a BCD operation and should be used to compare REALs to DECIMALs at decimal width.
Return Data Type: DECIMAL or REAL
Example:
!ROUND(5163,100) returns 5200
!ROUND(657.50,1) returns 658
!ROUND(51.63594,.01) returns 51.64
Commission = ROUND(Price / Rate,.01) !Round the commission to the nearest cent
See Also:
round_return_rounded_number_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1