Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Location
    india
    Posts
    67

    Unanswered: built in function to retreive decimal part

    Hi,

    Is ther any built in function in oracle to retreive decimal part when a float value is passed..
    example.......when 12.54 is passed,
    54 should be returned

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    As far as I can tell, no ... but you may create your own one (using ROUND, TRUNC etc.). Or, if on 10g or above, use regular expressions such as
    Code:
    SQL> select regexp_substr('12.54', '[[:digit:]]+$') result from dual;
    
    RE
    --
    54
    
    SQL>

  3. #3
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    select 12.54 - trunc(12.54) from dual;
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •