egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

adding dot to the count result

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
brood
Voice


Joined: 01 Sep 2005
Posts: 30

PostPosted: Sun Jul 01, 2007 1:47 pm    Post subject: adding dot to the count result Reply with quote

To count the colums i use:

Code:

"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
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Jul 01, 2007 5:49 pm    Post subject: Reply with quote

Code:
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]
 }
}

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
brood
Voice


Joined: 01 Sep 2005
Posts: 30

PostPosted: Sun Jul 01, 2007 6:14 pm    Post subject: Reply with quote

thanks Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber