This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

adding dot to the count result

Help for those learning Tcl or writing their own scripts.
Post Reply
b
brood
Voice
Posts: 30
Joined: Thu Sep 01, 2005 4:12 am

adding dot to the count result

Post by brood »

To count the colums i use:

Code: Select all

"SELECT count(*) from $table;"
Lets say the output is $cnt: 1392

Is it possible to let is show like: 1.392 (with the dot)

Same ofcourse if the count its more then a million: 1.234.323

thanks
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

if {[string len $number]>3} {
 for {set j [expr {[string len $number]-3}]} {$j > 0} {incr j -3} {
  set number [string range $number 0 [expr {$j-1}]].[string range $number $j end]
 }
}
b
brood
Voice
Posts: 30
Joined: Thu Sep 01, 2005 4:12 am

Post by brood »

thanks :D
Post Reply