dbTalk Databases Forums  

ROUND to nearest 0.05?

comp.databases.oracle.tools comp.databases.oracle.tools


Discuss ROUND to nearest 0.05? in the comp.databases.oracle.tools forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
dbarchitech
 
Posts: n/a

Default ROUND to nearest 0.05? - 01-12-2004 , 01:31 PM






Hey all,

For the new year we're updating our price lists to reflect an increase
of 1.5%, but... we need to round the prices to the nearest 0.05. Is
there a way to do this in SQL*Plus?

Basically I want to emulate the MROUND function in Excel (eg.
MROUND((cell*1.015), 0.05).

Thoughts?

Reply With Quote
  #2  
Old   
Sean Chang
 
Posts: n/a

Default Re: ROUND to nearest 0.05? - 01-12-2004 , 02:40 PM






select round( price*1.015*20) /20 from your_table;

"dbarchitech" <noble_kid (AT) mac (DOT) com> wrote

Quote:
Hey all,

For the new year we're updating our price lists to reflect an increase
of 1.5%, but... we need to round the prices to the nearest 0.05. Is
there a way to do this in SQL*Plus?

Basically I want to emulate the MROUND function in Excel (eg.
MROUND((cell*1.015), 0.05).

Thoughts?



-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----


Reply With Quote
  #3  
Old   
Richard Kuhler
 
Posts: n/a

Default Re: ROUND to nearest 0.05? - 01-12-2004 , 04:40 PM



Sean Chang wrote:

Quote:
select round( price*1.015*20) /20 from your_table;

"dbarchitech" <noble_kid (AT) mac (DOT) com> wrote in message
news:9d3dc423.0401121131.5266739f (AT) posting (DOT) google.com...

Hey all,

For the new year we're updating our price lists to reflect an increase
of 1.5%, but... we need to round the prices to the nearest 0.05. Is
there a way to do this in SQL*Plus?

Basically I want to emulate the MROUND function in Excel (eg.
MROUND((cell*1.015), 0.05).

Thoughts?

Why not just ...

round(price*1.015, 2)

--
Richard Kuhler



Reply With Quote
  #4  
Old   
Richard Kuhler
 
Posts: n/a

Default Re: ROUND to nearest 0.05? - 01-12-2004 , 04:45 PM



Richard Kuhler wrote:

Quote:
Sean Chang wrote:

select round( price*1.015*20) /20 from your_table;

"dbarchitech" <noble_kid (AT) mac (DOT) com> wrote in message
news:9d3dc423.0401121131.5266739f (AT) posting (DOT) google.com...

Hey all,

For the new year we're updating our price lists to reflect an increase
of 1.5%, but... we need to round the prices to the nearest 0.05. Is
there a way to do this in SQL*Plus?

Basically I want to emulate the MROUND function in Excel (eg.
MROUND((cell*1.015), 0.05).

Thoughts?



Why not just ...

round(price*1.015, 2)
Doh! Nevermind, I read the post too fast. Obviously the solution I
posted is wrong. You will have to perform the round as Sean already
correctly pointed out.

--
Richard Kuhler




Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.