03.02.2014, 11:00
So yeah, I have this stock
I pass it something between 1000 and 2000 and I get 49, I pass it something above 2000 and I get 50, and so forth. I was wondering why it's returning such strange numbers and if there's something wrong with the stock..
I've checked the integer i'm passing it, it's correct..
pawn Код:
stock GetFirstNumber(number)
{
new
number_str[12],
bool: negative;
if (number < 0) negative = true;
valstr(number_str, number);
return (negative) ? (number_str[1]) : (number_str[0]);
}
I've checked the integer i'm passing it, it's correct..