Re: [Gambas-user] Rounding numbers to pre-set increments

2009-04-30 Thread M0E Lnx
Thank you guys. The first suggestion worked. On Apr 30, 2009 3:24 PM, "Simonart Dominique" wrote: Frank Cox a écrit : > On Thu, 30 Apr 2009 14:00:06 -0500 > M0E Lnx wrote: > > >> I need a way to take a number, say an... A = N mod 250 N = N - A if A > 125 then N += 250 In this case N=125 would

Re: [Gambas-user] Rounding numbers to pre-set increments

2009-04-30 Thread Simonart Dominique
Frank Cox a écrit : > On Thu, 30 Apr 2009 14:00:06 -0500 > M0E Lnx wrote: > > >> I need a way to take a number, say an integer and round it up to the >> nearest increment of 250. This may imply decreasing or increasing the >> number. > > Divide the number by 250. > > If the result is > x.5 then

Re: [Gambas-user] Rounding numbers to pre-set increments

2009-04-30 Thread Frank Cox
On Thu, 30 Apr 2009 14:00:06 -0500 M0E Lnx wrote: > I need a way to take a number, say an integer and round it up to the > nearest increment of 250. This may imply decreasing or increasing the > number. Divide the number by 250. If the result is > x.5 then (x+1)*250 If the result is < x.5 the

[Gambas-user] Rounding numbers to pre-set increments

2009-04-30 Thread M0E Lnx
This dilema is running circles around my head... I need help I need a way to take a number, say an integer and round it up to the nearest increment of 250. This may imply decreasing or increasing the number. For instance input = 400 I need my app to round up to 500 input = 550 I need my app to ro