Sign in to follow this  
Followers 0
king9072

Changing A Variable To A Solid Number?

3 posts in this topic

Alright, a point in my script comes where I devide a number but it spits out a really ugly number like 8.342342356168543... and it is being inserted into a tooltip, thus it is a mess.

What I want to do is have that number rounded, but the round function wont use a variable.

I also think I remember seeing something where if you put some symbol infront of a variable, it will be read as a solid number and not as a variable.

Thanks in advance for help.

Share this post


Link to post
Share on other sites



; The following works for me with the current version of AutoIt (3.0.101)

$number = 8.342342356168543

$rounded = Round($number, 2) ;two-decimal places

MsgBox(4096,"Rounded", $rounded)


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

; The following works for me with the current version of AutoIt (3.0.101)

$number = 8.342342356168543

$rounded = Round($number, 2)  ;two-decimal places

MsgBox(4096,"Rounded", $rounded)

Thanks. I thought I had that the first time, but this works now :D

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