Money ,
#1

hi to all , i saw on every server or RP - RPG modes

they have on /stats or other commands etc..

10000$ is normal on every server

but they eddited to 10,000$ with "," how can i do this ? some answears ?

i tried to eddit %d$ to %,d$ didn't work
Reply
#2

Format Number - Slice

Код:
 new money = 100000, string[20];
Format(string, sizeof(string), "$%s" FormatNumber(money, ','));
// Specifier should be a string not integer 

SendClientMessage(playerid, -1, string);
Or
Format(string, sizeof(string), "$%s" FormatNumber(100000, ','));
(im on my Mobile:/)
Reply
#3

As he said correct if you want $ at end then %s$
Reply
#4

https://sampwiki.blast.hk/wiki/AddCommas
Код:
// credits to  Puffmac
stock AddCommas(number)
{
    new
        tStr[13]; // Up to 9,999,999,999,999
 
    format(tStr,sizeof(tStr),"%d",number);
 
    if(strlen(tStr) < 4)
 	return tStr;
 
    new
        //rNumber = floatround((number+(number/3)),floatround_floor),
        iPos = strlen(tStr),
        iCount = 1;
 
    while(iPos > 0)
    {
	if(iCount == 4)
	{
	    iCount = 0;
	    strins(tStr,",",iPos,1);
    	    iPos ++;
        }
 
        iCount ++;
        iPos --;
    }
    return tStr;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)