Feefty Posted October 14, 2012 Group: Members Topic Count: 47 Topics Per Day: 0.01 Content Count: 175 Reputation: 14 Joined: 11/21/11 Last Seen: April 18, 2020 Share Posted October 14, 2012 how do you add commas in every 3 digits? Quote Link to comment Share on other sites More sharing options...
0 AnnieRuru Posted December 10, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share 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 Link to comment Share on other sites More sharing options...
Euphy Posted October 14, 2012 Group: Members Topic Count: 72 Topics Per Day: 0.02 Content Count: 2997 Reputation: 1132 Joined: 05/27/12 Last Seen: June 1, 2017 Share 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 Link to comment Share on other sites More sharing options...
Feefty Posted October 15, 2012 Group: Members Topic Count: 47 Topics Per Day: 0.01 Content Count: 175 Reputation: 14 Joined: 11/21/11 Last Seen: April 18, 2020 Author Share 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 Link to comment Share on other sites More sharing options...
Question
Feefty
how do you add commas in every 3 digits?
Link to comment
Share on other sites
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.