Oracle: Pattern for to_char(number) to add additional ascii characters?

fdl picture fdl · Feb 25, 2009 · Viewed 28.3k times · Source

Using the Oracle to_char(number) function, is it possible to append ascii characters to the returned string?

Specifically, I need to add a percentage character to the returned string.

"select to_char(89.2244, '999G999G999G999G990D00') from dual" --> returns "89.22". I need a format pattern that returns "89.22%".

I am using this through reports in Application Express, so cannot simply concatenate "%" to the query, i need to put it in the number format.

Answer

Barry picture Barry · Feb 25, 2009

So you can't wrap the to_char with a CONCAT?

select concat(to_char(89.2244, '999G999G999G999G990D00'),'%') from dual