Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> TRUNC equivalent to return the decimal part?
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 - 17:00:21 CDT
![]() |
![]() |