Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Suppress digits after decimal point if integer
hi,
orauser_at_my-deja.com wrote:
>
> Is it possible to have a to_char number format to only
> print the .xx part of a number, if it is not
> an integer?
>
i don't think so.
you should write your own 'to_char' as a stored function or try
something like this:
select to_char( decode( mod( col, trunc( col )), 0, trunc( col ), col ))
from tab;
-- Andreas Necker ISB AG Tel: +49 (0)721/82800-0 Karlstrasse 52-54 Fax: +49 (0)721/82800-82 76133 Karlsruhe mailto:Andreas.Necker_at_isb-ka.de Germany http://www.isb-ka.deReceived on Wed Nov 15 2000 - 07:23:05 CST