How can I do from this: $1000 to this: $1,000.
#5

Quote:
Originally Posted by Bu11Sh0t
Посмотреть сообщение
Credits to Ryder (I think)
pawn Код:
stock convertNumber(iValue, iDelim[2] = ",", szNum[15] = "", iSize = sizeof(szNum)) {
    format(szNum, iSize, "%d", iValue < 0 ? -iValue : iValue);

    for(new i = strlen(szNum) - 3; i > 0; i -= 3) {
        strins(szNum, iDelim, i, iSize);
    }
    if(iValue < 0) {
        strins(szNum, "-", 0, iSize);
    }
    return szNum;
}
pawn Код:
public OnGameModeInit()
{
    convertNumber(500000);//500,000
    return 1;
}
Thank you! REP +.
Reply


Messages In This Thread
How can I do from this: $1000 to this: $1,000. - by Dokins - 17.07.2012, 15:29
Re: How can I do from this: $1000 to this: $1,000. - by MP2 - 17.07.2012, 15:33
Respuesta: How can I do from this: $1000 to this: $1,000. - by Bu11Sh0t - 17.07.2012, 15:36
Re: How can I do from this: $1000 to this: $1,000. - by Dokins - 17.07.2012, 15:37
Re: Respuesta: How can I do from this: $1000 to this: $1,000. - by Dokins - 17.07.2012, 15:39

Forum Jump:


Users browsing this thread: 2 Guest(s)