23.04.2012, 04:21
I've never seen this, so pardon me if it's already been posted:
Converting a price number (e.g. "$1000") into a price string (e.g. "$1,000"):
How this works: When you format a string or use SendClientMessageEx, you normally use "$%d" for a price. With this stock, you just use "%s" and it will convert it into currency format.
Example:
Stock:
Converting a price number (e.g. "$1000") into a price string (e.g. "$1,000"):
How this works: When you format a string or use SendClientMessageEx, you normally use "$%d" for a price. With this stock, you just use "%s" and it will convert it into currency format.
Example:
pawn Код:
format(string, sizeof(string), "This property is for sale!~n~Price: %s", ConvertPrice(HouseInfo[idx][Price]))");
pawn Код:
stock ConvertPrice(price)
{
new pricestring[32];
new j = valstr(pricestring,price);
while(j >= 4) { j -= 3; strins(pricestring,",",j); }
strins(pricestring,"$",0);
return pricestring;
}