Wrong loop result.
#4

Okay, when I deleted the "formatnumber" it did work and now showing correct but I would like to use my formatnumber stock too it puts "," to numbers like "$40,000"

Anything I could do to fix this?

here is my format number stock

Code:
stock FormatNumber(Float:amount)
{
	new str[16];
	format(str, sizeof(str), "%d", floatround(amount));
	new l = strlen(str);
	if (amount < 0) // -
	{
  		if (l > 4) strins(str, ",", l-3);
		if (l > 7) strins(str, ",", l-6);
		if (l > 10) strins(str, ",", l-9);
	}
	else
	{
		if (l > 3) strins(str, ",", l-3);
		if (l > 6) strins(str, ",", l-6);
		if (l > 9) strins(str, ",", l-9);
	}
	return str;
}
Reply


Messages In This Thread
Wrong loop result. - by Rongvaldyr - 19.01.2017, 00:56
Re: Wrong loop result. - by BroZeus - 19.01.2017, 04:20
Re: Wrong loop result. - by Rongvaldyr - 19.01.2017, 04:30
Re: Wrong loop result. - by Rongvaldyr - 19.01.2017, 04:35
Re: Wrong loop result. - by Rongvaldyr - 19.01.2017, 04:39

Forum Jump:


Users browsing this thread: 2 Guest(s)