Format Cash
#1

Fixed!
Reply
#2

pawn Код:
stock Comma(numbers)
{
    new temp[24],counter = -1;
    valstr(temp,numbers);
    for(new i = strlen(temp);i > 0; i--)
    {
        counter++;
        if(counter == 3)
        {
            strins(temp,",",i);
            counter = 0;
        }
    }
    return temp;
}
NOTE: it's by Gamer931215.
Reply
#3

Fixed!
Reply
#4

If on filterscripts, yes.
Reply
#5

This will not work, if you use negative values.

So write it like this:

PHP код:
stock comma(money//© by Kaliber
{
    new 
str[24],i;valstr(str,money),i=(money 0) ? strlen(str)-strlen(str)-4;
    for(; 
i>0i-=3strins(str,".",(money 0) ? i+1,24);
    return 
str;

Reply
#6

Fixed!
Reply
#7

Quote:
Originally Posted by Sc0pion
Посмотреть сообщение
Not working bro.
Show us the code ... how you used it?
Reply
#8

Fixed!
Reply
#9

1. Use my function...

2. Yes but you should show us the code, where you use this function
Reply
#10

pawn Код:
stock Comma(numbers)
{
    new temp[24];
    valstr(temp, numbers);
    for(new i = strlen(temp) - 3; i > 0; i -= 3)
    {
        if(temp[i - 1] != '-') strins(temp, ",", i);
    }
    return temp;
}
Not that hard, is it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)