Hi,
Does anyone have a routine to ROUNDUP a number? I would appreciate your help.
Roundup routine
Moderators: chulett, rschirm, roy
The INT() function will return 1 for 1.499 and 2 for 1.50001. Is this what you are looking for?
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
I would just use simple math; you can write your own roundup routine:
Roundup(Value,Places)
Hmmm, this could actually be an inline transform as well.
Roundup(Value,Places)
Code: Select all
Shift = 10**Places
Ans = INT(Value*Shift)/Shift
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The INT() function is not what you want. The FIX() function will be close. Use 0 for the mode argument to get correct arithmetic rounding.
Code: Select all
FIX(number, precision, mode)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I'm surprised. On my system Int(1.50001) returned 1. This does not accord with the original requirement. Int() returns the largest integer smaller than the argument.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.