[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
RE: [sqr-users] Rounding up to the nearest 1000 in SQR
Or... you could add 500 and round.
Richard Knapp
Database Programmer/Analyst
Institutional Research and Planning
University of Missouri System
573-882-8856
knappr@umsystem.edu
-----Original Message-----
From: George Jansen [mailto:GJANSEN@aflcio.org]
Sent: Wednesday, July 30, 2003 9:28 AM
To: sqr-users@sqrug.org
Subject: Re: [sqr-users] Rounding up to the nearest 1000 in SQR
Oracle will let you round to an explicit number of places, positive for
after the decimal, negative for before. But that's rounding, not
rounding up. Pehaps the Ontko.com clan knows a cleaner way, but I'd use
the ceil function:
begin-setup
declare-variable
integer #y
end-declare
end-setup
begin-procedure k-round(#raw, :#rounded)
let #rounded = ceil(#raw/1000) * 1000
end-procedure
begin-program
let #x = 950.00
while #x < 1100
do k-round(#x, #y)
show #y
let #x = #x + 50
end-while
end-program
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users