Formatting number - I will +rep
#6

pawn Код:
// 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;
}
Reply


Messages In This Thread
Formatting number - I will +rep - by friezakinght - 09.07.2014, 14:52
Re: Formatting number - I will +rep - by rockhopper - 09.07.2014, 15:11
Re: Formatting number - I will +rep - by Stanford - 09.07.2014, 15:15
Re: Formatting number - I will +rep - by friezakinght - 09.07.2014, 15:22
Re: Formatting number - I will +rep - by Dziugsas - 09.07.2014, 15:41
Re: Formatting number - I will +rep - by Djole1337 - 09.07.2014, 15:45
Re: Formatting number - I will +rep - by friezakinght - 09.07.2014, 15:47

Forum Jump:


Users browsing this thread: 1 Guest(s)