Money , - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Money , (
/showthread.php?tid=574324)
Money , -
StR_MaRy - 16.05.2015
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
Re: Money , -
ToiletDuck - 16.05.2015
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:/)
Re: Money , -
fuckingcruse - 16.05.2015
As he said correct if you want $ at end then %s$
Re: Money , -
dominik523 - 16.05.2015
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;
}