You can use the CAST() function in Oracle to convert float to integer. Also, you can use an integer data type variable in PL/SQL. Below are the examples.
Oracle CAST() Function Example to Convert Float to Ineger
select cast(2.330 as int) from dual;
Output
2
Convert Using INTEGER Data Type
declare n_int integer; f_float float := 45.56; begin n_int := f_float; dbms_output.put_line(n_int); end;
Output
46
Statement processed.
0.00 seconds
Leave a comment
You must login or register to add a new comment.