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

Home -> Community -> Usenet -> c.d.o.server -> Re: Simple rounding query

Re: Simple rounding query

From: Erik Ykema <ErikFOO_at_ykema.ws>
Date: Wed, 16 Jun 2004 13:36:12 +0200
Message-ID: <40d030b5$0$93324$e4fe514c@news.xs4all.nl>


"Jeremy" <newspostings_at_hazelweb.co.uk> wrote in message news:MPG.1b3a10a5f005d4cb989c66_at_news.individual.net...
> Perhaps I'm being a bit thick here, but is there a single function call
> I can make in pl/sql (8.1.7.x) which wil round up to the next integer?
> I want:
> 29/10 = 3
> 30/10 = 3
> 31/10 = 4

What about the standard SQL-function CEIL? http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/functions16a.htm#97803 Ceil (x) returns the smallest integer equal to or greater than x, hence ceil (29/10)=ceil(2.9)=3
ceil(30/10)=ceil(3)=3
ceil(31/10)=ceil(3.1)=4
Good luck,
Erik Ykema Received on Wed Jun 16 2004 - 06:36:12 CDT

Original text of this message

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