was wondering if anyone had a code to put commas in really long numbers, such as 1000000 would be turned into 1,000,000. i currently have a piece of code that does this for me that i got from a site, but its kinda "not working" right with some of my scripts.
Yo momma's so fat she can be in the past, present, n future all at once
I am sure there is a regsub procedure on the forum from many many moons ago, that took care of this in a quick and simple step. I sugest you search for this, however, here is a normal version.
proc groupdigits {in {sep {,}}} {
set out ""
set in [split $in {}]
while {[llength $in]} {
set out "${sep}[join [lrange $in end-2 end] {}]${out}"
set in [lreplace $in end-2 end]
}
return [string trimleft $out $sep]
}