| View previous topic :: View next topic |
| Author |
Message |
tueb Halfop
Joined: 04 Oct 2007 Posts: 76 Location: #quiz.de @ irc.gamesurge.net
|
Posted: Wed Dec 22, 2010 6:03 am Post subject: trim number [solved] |
|
|
Hi,
I calculate a duration by milliseconds by using:
"set dur [expr ([clock clicks -milliseconds] - $timeasked) * 0.001]"
that usually gives me a time like "64.409".
But on some networks (i.e. quakenet) i get times like "64.408999999999999".
How do i trim the number to three decimals?
thanks in advance,
tueb _________________ #Quiz.de @ irc.GameSurge.net
JavaChat
Last edited by tueb on Wed Dec 22, 2010 7:00 am; edited 1 time in total |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Wed Dec 22, 2010 6:58 am Post subject: Re: trim number |
|
|
| Code: | | set dur [format %.3f [expr {([clock clicks -milliseconds] - $timeasked) * 0.001}]] |
_________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
tueb Halfop
Joined: 04 Oct 2007 Posts: 76 Location: #quiz.de @ irc.gamesurge.net
|
Posted: Wed Dec 22, 2010 7:00 am Post subject: |
|
|
thanks! _________________ #Quiz.de @ irc.GameSurge.net
JavaChat |
|
| Back to top |
|
 |
|