Sign in to follow this  
Followers 0
muzle6074

How can I remove these decimal pts?

4 posts in this topic

for $i = Random(180, 210) to 0 step -1
            Sleep(1000)
            ToolTip("Post break time remaining: " & $i , 0, 0)          
        Next

My problem is when the tooltip displays it says "Post break time remaining: 189.7493845734895 (for example). How can I get it to not display all the decimal pts?

Share this post


Link to post
Share on other sites



for $i = Random(180, 210) to 0 step -1
             Sleep(1000)
             ToolTip("Post break time remaining: " & $i , 0, 0)         
         Next

My problem is when the tooltip displays it says "Post break time remaining: 189.7493845734895 (for example). How can I get it to not display all the decimal pts?

Two solution, force Random() to return a integer: Random(180,210,1) or use the Round() function :)

Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites

Hi,

for $i = Random(180, 210, 1) to 0 step -1

or

ToolTip("Post break time remaining: " & Round($i), 0, 0)

or

ToolTip("Post break time remaining: " & Ceiling($i), 0, 0)

or

ToolTip("Post break time remaining: " & Floor($i), 0, 0)

Cheers

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Thanks for the prompt reply monoceres and smashly :)

Edited by muzle6074

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0