01.06.2015, 11:25
Both Vince's and my code work good. What are you trying to accomplish anyway?
EDIT: Okay, I see "-,100,000,000". Replace with:
and it'll be fixed.
EDIT 2: Or even better as Vince tip:
EDIT: Okay, I see "-,100,000,000". Replace with:
pawn Код:
for (new i = strlen(string) - 1, j = ((integer < 0) ? 1 : 0); i > j; --i)
EDIT 2: Or even better as Vince tip:
pawn Код:
IntegerWithDelimiter(integer, delimiter[] = ",")
{
new
string[16];
format(string, sizeof(string), "%d", integer);
for (new i = strlen(string) - 3, j = ((integer < 0) ? 1 : 0); i > j; i -= 3)
{
strins(string, delimiter, i, sizeof (string));
}
return string;
}