Convert char to number
SQL>
SQL> DECLARE
2 myChar VARCHAR2(20) := '$119,252.75';
3 myNumber NUMBER ;
4 BEGIN
5 myNumber := TO_Number(myChar,'$999,999.99');
6 DBMS_OUTPUT.PUT_LINE('The converted number is: ' || myNumber);
7 DBMS_OUTPUT.PUT_LINE('Your commission at 6% is: ' || (myNumber*.06));
8 END;
9 /
The converted number is: 119252.75
Your commission at 6% is: 7155.165
PL/SQL procedure successfully completed.
SQL>
Related examples in the same category