Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: TRUNC equivalent to return the decimal part?
math tells me
you want value-trunc(value)
"funkia" <yian_at_die.net> wrote in message
news:550d192c.0304091400.3a0bb654_at_posting.google.com...
> I've been searching Google and other docs online for a while now, and
> have been unable to find any built-in function that resembles what I
> need. I have a calculated number result for which I need to do a
> conversion on the decimal part of the number. Is there any function
> in SQL that is like TRUNC that returns just the decimal portion?
>
> e.g., if my number is 36.675, I want a function that will return just
> .675 (with or without the period)
>
> I know that it's possible to do this with either of the following:
> 1. decimal = number - trunc(number)
> OR
> 2. substr
>
> However, my calculated number is created from a complex expression in
> itself that I would rather not wrap more functions are. It seems that
> there has to be an elegant and simple way to achieve this -
> suggestions?
>
> Thanks!
Received on Wed Apr 09 2003 - 20:58:38 CDT
![]() |
![]() |