Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

convert varchar to Number

587126Feb 2 2015 — edited Feb 3 2015

Hi,

version : Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production

We are getting amounts in varchar, we need to convert to number. We will receive only number, comma(s) and decimal in this field.

Rules :

******

1) consider first 6 digits of left to decimal

2) consider first 2 digits of right to decimal

Actual

---------

'       4,239,289.710'

'         260,000.950'

'      23,370,472.973'

'              15.567'

'     178,234,666.129'

Expected

---------

239289.71

260000.95

370472.97

       15.56

234666.12

Thanks

Raghu

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 3 2015
Added on Feb 2 2015
6 comments
374 views