09.07.2014, 14:52
Hi guys, how can I make that when I have 50000 cash it actually shows 50.000? Please help me I will +rep
new cashtring[32];
new cash= pData[id][pCash];
new j = valstr(cashstring,cash);
while(j >= 4) { j -= 3; strins(cashstring,",",j); }
// I've no idea who made it.
stock FormatNumber(number) {
new szString[13];
format(szString,sizeof(szString), "%d", number);
if (strlen(szString) < 4)
return szString;
new iPos = strlen(szString), iCount = 1;
while (iPos) {
if(iCount == 4) {
iCount = 0;
strins(szString,",",iPos,1);
iPos ++;
}
iCount ++;
iPos --;
}
return szString;
}