Feefty Posted October 14, 2012 Posted October 14, 2012 how do you add commas in every 3 digits? Quote
0 AnnieRuru Posted December 10, 2012 Posted December 10, 2012 update to this topic same thing ... negative number support 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$; } 1 Quote
Euphy Posted October 14, 2012 Posted October 14, 2012 // Use: Cm(number) function Cm { set .@str$, getarg(0); for(set .@i,getstrlen(.@str$)-3; .@i>0; set .@i,.@i-3) set .@str$, insertchar(.@str$,",",.@i); return .@str$; } (credits to Joseph) Quote
Feefty Posted October 15, 2012 Author Posted October 15, 2012 // Use: Cm(number) function Cm { set .@str$, getarg(0); for(set .@i,getstrlen(.@str$)-3; .@i>0; set .@i,.@i-3) set .@str$, insertchar(.@str$,",",.@i); return .@str$; } (credits to Joseph) ill try it out, thanks! Quote
Question
Feefty
how do you add commas in every 3 digits?
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.