11.15. Numeric Functions

The following includes common numeric functions you can use in PL/SQL programs.

ABSReturns the absolute value. The argument is any expression that evaluates to a number. var := ABS(var_1 - 100);
MODReturns the remainder following division. The following returns 3. MOD(11,4);
ROUNDThe ROUND function rounds a number or a date. You can specify the decimal place for the rounding. Use a second parameter to indicate the degree of rounding. Positive means round that many places to the right. Negative means round that many places to the left of the decimal point. The following includes some rounding examples.
 ROUND(199.11); -- rounds to 200 ROUND(199.11, 1); -- rounds to 199.1 ROUND(199.125, 2); -- rounds to 199.13 ROUND(249.11, ...

Get Programming Oracle® Triggers and Stored Procedures, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.