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 number to string - Mask

user12282526Dec 12 2010 — edited Dec 12 2010
Hi,

I want to convert a number (EX: 2541.75) into a varchar2: 19 charachters where the last character is the sign
The resulted don't have to containe "."

number: 2541.75
varchar2: 000000000000254175+

i tried with below mask

SELECT TO_CHAR(2517.25, '000000999999999999S') FROM DUAL

and the result is 000000000000002517+, without decimals

if i changed the mask into SELECT TO_CHAR(2517.25, '000009999999999.99S') FROM DUAL
the result will be 000000000002517.25+, but i don't want to have any dots.

There is another way to convert this number with decimals into a string without dots?

Thanks,
Madalin
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 9 2011
Added on Dec 12 2010
4 comments
506 views