var
pixels = (_IconWidth * width)
tiles = ceil(pixels / 32)
modifier = ((width>=7)?(3.5):(2.5))
startloc = round((pixels + tiles*32)/modifier)
for(var/i=1, i<=width, ++i)
_DrawNumber(copytext(number,i,i+1), -startloc+((i-1)*_IconWidth), location, color)
I need to know how to center the numbers. startloc is the position I start from. I can't seem to figure it out.
[Edit]
I used a variable called modifier to divide pixels+tiles*32 and it works perfectly. I don't remember my reason for doing this, though.
Here's your problem:
Randomly changing the math around isn't going to help you. You need to think through the problem. When you posted this in chat earlier you were much closer to being correct, but I see you've done some wacky stuff like put parentheses around pixels/2 instead of leaving the /2 outside of it all, or putting - in front of the whole thing. What you're doing here makes no sense.
This is the correct formula:
Lummox JR