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 

[Solved] Limit result

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


Joined: 04 Oct 2006
Posts: 49

PostPosted: Fri Dec 01, 2006 2:52 am    Post subject: [Solved] Limit result Reply with quote

hi there \o.

I have a dumb question , but i can't solve it :/

Code:

[expr $numb*100/$numb + 0.0]


for example the result was 15.546576874687853 , i want to limit the result to *.###, in this example the result that i wanted was 15.546.

tnks in advance.


Last edited by w00f on Tue Dec 05, 2006 9:20 pm; edited 1 time in total
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Fri Dec 01, 2006 3:37 am    Post subject: Reply with quote

take a look at the format command

the output spec you need is %.3f
_________________
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
Access
Voice


Joined: 04 Jun 2006
Posts: 22

PostPosted: Tue Dec 05, 2006 5:43 am    Post subject: Reply with quote

i think u want 15.547
Back to top
View user's profile Send private message
w00f
Halfop


Joined: 04 Oct 2006
Posts: 49

PostPosted: Tue Dec 05, 2006 9:19 pm    Post subject: Reply with quote

tnks demond []

Solved the problem.

@Access in this case, that doesn't make any difference, tnks anyway
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