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: Jeremy <newspostings_at_hazelweb.co.uk>
Date: Wed, 16 Jun 2004 09:20:35 +0100
Message-ID: <MPG.1b3a13325a6eb7da989c67@news.individual.net>


In article <MPG.1b3a10a5f005d4cb989c66_at_news.individual.net>, Jeremy says...
> 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
>

Bad form to follow up one'e own post but here is the 'solution' I used - it is inelegant:

declare
a number := 31;
b number := 10;
res number;
begin
  res := trunc(a/b);

Seems to work but is a little long-winded.

-- 

jeremy
Received on Wed Jun 16 2004 - 03:20:35 CDT

Original text of this message

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