Jump to content
  • 0

[HELP] Numere cu virgula ( 10000 >> 10,000 )


Seba97

Question

6 answers to this question

Recommended Posts

[pawn]

format(coordsstring, sizeof(coordsstring), "Ai %s"DecimalPoint(playerid));

SendClientMessage(playerid, 0x7979FFFF,coordsstring);

stock DecimalPoint(playerid)

{

    new str[30];

    new cash=GetPlayerMoney(playerid);

    if(cash >= 0)

    {

        format(str, sizeof(str), "$%d", cash);

        if(1000 <= cash < 10000) strins(str, ".", 2, sizeof(str));

        else if(10000 <= cash < 100000) strins(str, ".", 3, sizeof(str));

        else if(100000 <= cash < 1000000) strins(str, ".", 4, sizeof(str));

        else if(1000000 <= cash < 10000000) { strins(str, ".", 2, sizeof(str)); strins(str, ".", 6, sizeof(str)); }

        else if(10000000 <= cash < 100000000) { strins(str, ".", 3, sizeof(str)); strins(str, ".", 7, sizeof(str)); }

        else if(100000000 <= cash < 1000000000) { strins(str, ".", 4, sizeof(str)); strins(str, ".", 8, sizeof(str)); }

        else if(cash >= 1000000000) { strins(str, ".", 2, sizeof(str)); strins(str, ".", 6, sizeof(str)); strins(str, ".", 10, sizeof(str)); }

    }

    else

    {

        format(str, sizeof(str), "-$%d", cash-(cash*2));

        if(-1000 >= cash > -10000) strins(str, ".", 3, sizeof(str));

        else if(-10000 >= cash > -100000) strins(str, ".", 4, sizeof(str));

        else if(-100000 >= cash > -1000000) strins(str, ".", 5, sizeof(str));

        else if(-1000000 >= cash > -10000000) { strins(str, ".", 3, sizeof(str)); strins(str, ".", 7, sizeof(str)); }

        else if(-10000000 >= cash > -100000000) { strins(str, ".", 4, sizeof(str)); strins(str, ".", 8, sizeof(str)); }

        else if(-100000000 >= cash > -1000000000) { strins(str, ".", 5, sizeof(str)); strins(str, ".", 9, sizeof(str)); }

        else if(cash <= -1000000000) { strins(str, ".", 3, sizeof(str)); strins(str, ".", 7, sizeof(str)); strins(str, ".", 11, sizeof(str));}

    }

    return str;

}

[/pawn]

Stiu si eu ... branza e pe bani, dar eu tot ma joc pe gratis!

Link to comment
Share on other sites

[pawn]

format(coordsstring, sizeof(coordsstring), "Ai %s"DecimalPoint(playerid));

SendClientMessage(playerid, 0x7979FFFF,coordsstring);

stock DecimalPoint(playerid)

{

    new str[30];

    new cash=GetPlayerMoney(playerid);

    if(cash >= 0)

    {

        format(str, sizeof(str), "$%d", cash);

        if(1000 <= cash < 10000) strins(str, ".", 2, sizeof(str));

        else if(10000 <= cash < 100000) strins(str, ".", 3, sizeof(str));

        else if(100000 <= cash < 1000000) strins(str, ".", 4, sizeof(str));

        else if(1000000 <= cash < 10000000) { strins(str, ".", 2, sizeof(str)); strins(str, ".", 6, sizeof(str)); }

        else if(10000000 <= cash < 100000000) { strins(str, ".", 3, sizeof(str)); strins(str, ".", 7, sizeof(str)); }

        else if(100000000 <= cash < 1000000000) { strins(str, ".", 4, sizeof(str)); strins(str, ".", 8, sizeof(str)); }

        else if(cash >= 1000000000) { strins(str, ".", 2, sizeof(str)); strins(str, ".", 6, sizeof(str)); strins(str, ".", 10, sizeof(str)); }

    }

    else

    {

        format(str, sizeof(str), "-$%d", cash-(cash*2));

        if(-1000 >= cash > -10000) strins(str, ".", 3, sizeof(str));

        else if(-10000 >= cash > -100000) strins(str, ".", 4, sizeof(str));

        else if(-100000 >= cash > -1000000) strins(str, ".", 5, sizeof(str));

        else if(-1000000 >= cash > -10000000) { strins(str, ".", 3, sizeof(str)); strins(str, ".", 7, sizeof(str)); }

        else if(-10000000 >= cash > -100000000) { strins(str, ".", 4, sizeof(str)); strins(str, ".", 8, sizeof(str)); }

        else if(-100000000 >= cash > -1000000000) { strins(str, ".", 5, sizeof(str)); strins(str, ".", 9, sizeof(str)); }

        else if(cash <= -1000000000) { strins(str, ".", 3, sizeof(str)); strins(str, ".", 7, sizeof(str)); strins(str, ".", 11, sizeof(str));}

    }

    return str;

}

[/pawn]

EU vroiam pt toate numerele ! nu numa la cash !

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.