20.06.2010, 01:24
fix: http://bluerey.pastebin.com/e82A5hfU
pawn Код:
stock FormatMoney(Float:amount,delimiter[2]=",")
{
#define MAX_MONEY_STRING 16
new txt[MAX_MONEY_STRING];
format(txt,MAX_MONEY_STRING,"%d",floatround(amount));
new l = strlen(txt);
if(amount < 0)
{
if(l >= 5) strins(txt,delimiter,l-3);
if(l >= 8) strins(txt,delimiter,l-6);
if(l >= 11) strins(txt,delimiter,l-9);
}
else
{
if(l >= 4) strins(txt,delimiter,l-3);
if(l >= 7) strins(txt,delimiter,l-6);
if(l >= 10) strins(txt,delimiter,l-9);
}
return txt;
}