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: Eric Parker <eric.parkerthedross_at_virgin.net>
Date: Wed, 16 Jun 2004 10:27:46 +0100
Message-ID: <2jai4jFvg9b0U1@uni-berlin.de>

"Cris Carampa" <cris119_at_operamail.com> wrote in message news:caovo8$eh1$1_at_panco.nettuno.it...
> Jeremy wrote:
>
> > 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
>
>
> z := trunc(x/y)+case x mod y when 0 then 0 else 1 end ;
>
> Kind regards,
>
> --
> Stay hard, stay hungry, stay alive if you can
> And meet me in a dream of this hard land
>
> Cris Carampa (spamto:cris119_at_operamail.com)

Or even

z := trunc((x-1)/y)+1;

eric

--
Remove the dross to contact me directly
Received on Wed Jun 16 2004 - 04:27:46 CDT

Original text of this message

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