Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> TRUNC equivalent to return the decimal part?

TRUNC equivalent to return the decimal part?

From: funkia <yian_at_die.net>
Date: 9 Apr 2003 15:00:21 -0700
Message-ID: <550d192c.0304091400.3a0bb654@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 - 17:00:21 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US