PDA

View Full Version : commas


BadJih
22/06/2018, 02:21 AM
Hello there,

I want to add comma's to the biz price (ex: $1000000 > $1,000,000)
please someone set it to the code, i tried almost all stuff myself but i failed in it...

This is its code


if(BizInfo[business][bOwned] == 0)
{
new pricestring[32];
new price = BizInfo[business][bValue];
new j = valstr(pricestring,price);
while(j >= 4) { j -= 3; strins(pricestring,",",j); }
strins(pricestring,"$",0);
format(string, sizeof(string), "%s\nStatus: For Sale\nPrice: %s",BizInfo[business][bName],pricestring);

Verc
22/06/2018, 04:13 AM
See this http://forum.sa-mp.com/showthread.php?t=184328