PL/SQL (MOSC)

MOSC Banner

REGEXP_REPLACE to convert -1,234.56 to -1234.56

edited May 11, 2016 5:47AM in PL/SQL (MOSC) 14 commentsAnswered ✓

Hi All,

Need help to convert varchar2 value to NUMBER by removing alpha bates & any other special charactetrs except -(minus) & .(decimal)

e.g.  -0.1,23,456 to -0.123456

-18,345.234. to -18345.234

2.61E-12 to 0.00000000000261

Tried below

SELECT REGEXP_REPLACE(' -0.1,23,456', '[^0-9 and . ]+', '') FROM DUAL

Result:

0.123456

Thanks & Regards,

Prashant

Tagged:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center