Rounding help...
#5

Quote:
Originally Posted by ♣ ⓐⓢⓢ
pawn Код:
new rounded, num;
num = 46;
if((num % 5) > 2) num += 5;
rounded = num / 5 * 5;
Or

pawn Код:
new rounded, num;
num = 46;
rounded = floatround(floatdiv(num, 5.0), floatround_round) * 5;
Great! Thanks! Btw, what is the operator or w/e '%' for? e.g. if((num % 5) > 2) num += 5;
Reply


Messages In This Thread
Rounding help... - by lesley - 13.03.2009, 21:07
Re: Rounding help... - by Pyrokid - 13.03.2009, 21:49
Re: Rounding help... - by lesley - 13.03.2009, 23:11
Re: Rounding help... - by Nero_3D - 13.03.2009, 23:21
Re: Rounding help... - by lesley - 14.03.2009, 00:05
Re: Rounding help... - by maij - 14.03.2009, 06:46
Re: Rounding help... - by lesley - 14.03.2009, 09:27
Re: Rounding help... - by Nero_3D - 14.03.2009, 13:19

Forum Jump:


Users browsing this thread: 1 Guest(s)