How to put comma's in numbers?

Jedzkie

The Master of White Spaces
Messages
632
Points
0
Age
33
Location
Philippines
Discord
✪ Jedzkie#0662
IRC Nickname
Jedzkie
Github
Jedzkie
Emulator
Client Version
2016-03-16 RE
Hi!

How can i put comma's in number thru script? not a manually input a comma in number, i need a automated comma in every 3 digits.

for example:

before:

You have 1000 Cash Points.

After:

You have 1,000 Cash Points.

Regards,

Frost

 
You know, I've been wondering this too @@Frost. I'm not quite sure if that is possible, like

.@var = 100000

mes "You have "+.@var+" points";

It just kind of looks unprofessional without commas. I get what you mean and I'm  not sure it is possible, you might be stuck with manually having to put the " , " in place of your integers inside your scripts. :/

Now someone correct me if I'm wrong!

 
@@Frost

try this one Credit with AnnieRuru from rAthena

function script int__ { .@i = getstrlen( .@str$ = getarg(0) ) -3; .@is_negative = charat( .@str$, 0 ) == "-"; while ( .@i > .@is_negative ) { .@str$ = insertchar( .@str$, ",", .@i ); .@i -= 3; } return .@str$;}
or this one from eAthena

http://www.eathena.ws/board/index.php?showtopic=170497
How do i insert it in my script?

sorry new i scripting
default_biggrin.png


 
Back
Top