Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 09:29 PM
kboudreau
Guest
 
Posts: n/a
Default Oracle rounding question


rounding question....

I have this:

1 select cltv

2 from empower.mtgterms

3* where lnkey = '304076'

SQL> /



CLTV

----------

81.1549296


SQL> select round(cltv,2)

2 from empower.mtgterms

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(cltv,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
  #2  
Old July 19th, 2005, 09:29 PM
nobody
Guest
 
Posts: n/a
Default 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@dbforums.com> wrote in message
news:3097653.1057874728@dbforums.com...[color=blue]
>
> rounding question....
>
> I have this:
>
> 1 select cltv
>
> 2 from empower.mtgterms
>
> 3* where lnkey = '304076'
>
> SQL> /
>
>
>
> CLTV
>
> ----------
>
> 81.1549296
>
>
> SQL> select round(cltv,2)
>
> 2 from empower.mtgterms
>
> 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(cltv,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[/color]


  #3  
Old July 19th, 2005, 09:29 PM
Ivica Dimjasevic
Guest
 
Posts: n/a
Default Re: Oracle rounding question

SQL> select round(cltv + 0.01, 2) from empower.mtgterms where lnkey =
'304076'

Ivica



"kboudreau" <member33017@dbforums.com> wrote in message
news:3097653.1057874728@dbforums.com...[color=blue]
>
> rounding question....
>
> I have this:
>
> 1 select cltv
>
> 2 from empower.mtgterms
>
> 3* where lnkey = '304076'
>
> SQL> /
>
>
>
> CLTV
>
> ----------
>
> 81.1549296
>
>
> SQL> select round(cltv,2)
>
> 2 from empower.mtgterms
>
> 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(cltv,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[/color]

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles