Quote:
Originally Posted by liquor
pawn Код:
stock NiceNumber(iNum, const szChar[] = ",") { new szStr[16] ; format(szStr, sizeof(szStr), "%d", iNum);
for(new iLen = strlen(szStr) - 3; iLen > 0; iLen -= 3) { strins(szStr, szChar, iLen); } return szStr; }
pawn Код:
NiceNumber(12345)
Will output: 12,345 for example
pawn Код:
format(str,sizeof(str),"This is how much it is: %d",NiceNumber(12345)); str will output: This is how much it is: 12,345
|
Yours is much nicer than mine... my pawn is about 7 years rusty, didn't even think you could return arrays in functions