function
#3

pawn Код:
stock number_format(amount)
{
    new
        money[16],
        negativ = 0;
    if(amount < 0) negativ = 1;
    format(money, sizeof(money), "%i", amount);
    new
        lenght = strlen(money);
    while((lenght -= 3) > negativ) strins(money, ".", lenght);
    return money;
}

// This would print 1.500

main()
{
     prinft("%s", number_format(1500));
}
Reply


Messages In This Thread
function - by _ReloadeD_ - 05.02.2012, 20:09
Re: function - by Mosslah - 05.02.2012, 21:32
Re: function - by Cameltoe - 05.02.2012, 21:38
Re: function - by _ReloadeD_ - 07.02.2012, 14:38

Forum Jump:


Users browsing this thread: 1 Guest(s)