Oracle rounding question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kboudreau

    Oracle rounding question


    rounding question....

    I have this:

    1 select cltv

    2 from empower.mtgterm s

    3* where lnkey = '304076'

    SQL/



    CLTV

    ----------

    81.1549296


    SQLselect round(cltv,2)

    2 from empower.mtgterm s

    3 where lnkey = '304076'

    4 /



    ROUND(CLTV,2)

    -------------

    81.15


    I need it to round the entire number 81.1549296 to 2 decimal places
    which would bring 81.16 (6 rounds the 9 to 0 rounds the 2 to 3 rounds
    the 9 to 9 rounds the 4 to 5 rounds the 5 to 6 giving 81.16). I can't
    use round(round(clt v,3),2) as I don't know in advance how far
    out the decimal precision will be. Is there some oracle function that
    can help with this?

    --
    Posted via http://dbforums.com
  • nobody

    #2
    Re: Oracle rounding question

    basic math says round of
    81.1549296
    says the answer is 81.15
    round of 81.155 to 2 decimals would be 81.16


    "kboudreau" <member33017@db forums.comwrote in message
    news:3097653.10 57874728@dbforu ms.com...
    >
    rounding question....
    >
    I have this:
    >
    1 select cltv
    >
    2 from empower.mtgterm s
    >
    3* where lnkey = '304076'
    >
    SQL/
    >
    >
    >
    CLTV
    >
    ----------
    >
    81.1549296
    >
    >
    SQLselect round(cltv,2)
    >
    2 from empower.mtgterm s
    >
    3 where lnkey = '304076'
    >
    4 /
    >
    >
    >
    ROUND(CLTV,2)
    >
    -------------
    >
    81.15
    >
    >
    I need it to round the entire number 81.1549296 to 2 decimal places
    which would bring 81.16 (6 rounds the 9 to 0 rounds the 2 to 3 rounds
    the 9 to 9 rounds the 4 to 5 rounds the 5 to 6 giving 81.16). I can't
    use round(round(clt v,3),2) as I don't know in advance how far
    out the decimal precision will be. Is there some oracle function that
    can help with this?
    >
    --
    Posted via http://dbforums.com

    Comment

    • Ivica Dimjasevic

      #3
      Re: Oracle rounding question

      SQLselect round(cltv + 0.01, 2) from empower.mtgterm s where lnkey =
      '304076'

      Ivica



      "kboudreau" <member33017@db forums.comwrote in message
      news:3097653.10 57874728@dbforu ms.com...
      >
      rounding question....
      >
      I have this:
      >
      1 select cltv
      >
      2 from empower.mtgterm s
      >
      3* where lnkey = '304076'
      >
      SQL/
      >
      >
      >
      CLTV
      >
      ----------
      >
      81.1549296
      >
      >
      SQLselect round(cltv,2)
      >
      2 from empower.mtgterm s
      >
      3 where lnkey = '304076'
      >
      4 /
      >
      >
      >
      ROUND(CLTV,2)
      >
      -------------
      >
      81.15
      >
      >
      I need it to round the entire number 81.1549296 to 2 decimal places
      which would bring 81.16 (6 rounds the 9 to 0 rounds the 2 to 3 rounds
      the 9 to 9 rounds the 4 to 5 rounds the 5 to 6 giving 81.16). I can't
      use round(round(clt v,3),2) as I don't know in advance how far
      out the decimal precision will be. Is there some oracle function that
      can help with this?
      >
      --
      Posted via http://dbforums.com

      Comment

      Working...