How can formatnumber?
#4

pawn Код:
IntegerWithDelimiter(integer, delimiter[] = ",") {
    new string[16];

    format(string, sizeof string, "%i", integer);

    for (new i = strlen(string) - 3, j = ((integer < 0) ? 1 : 0); i > j; i -= 3) {

        strins(string, delimiter, i, sizeof string);
    }

    return string;
}
Usage:

pawn Код:
format(string, sizeof ( string ), "$ %s", IntegerWithDelimiter (1000000 )) ;
Reply


Messages In This Thread
How can formatnumber? - by rockys - 23.12.2018, 01:46
Re: How can formatnumber? - by SyS - 23.12.2018, 01:51
Re: How can formatnumber? - by rockys - 23.12.2018, 08:23
Re: How can formatnumber? - by Dignity - 23.12.2018, 08:37
Re: How can formatnumber? - by DAKYSKYE - 23.12.2018, 09:04
Re: How can formatnumber? - by TheToretto - 23.12.2018, 09:07

Forum Jump:


Users browsing this thread: 3 Guest(s)