manve1 Posted November 17, 2012 Posted November 17, 2012 I get a problem when i get element health and put it on a label, it always gives me like: 82.57222719 How can i get rid of the numbers after decimal? Looking for tutorials or information? check out: www.simpleask.co.uk
manve1 Posted November 17, 2012 Author Posted November 17, 2012 ty Looking for tutorials or information? check out: www.simpleask.co.uk
Anderl Posted November 18, 2012 Posted November 18, 2012 You can also use math.floor depending on how you want the number. "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
manve1 Posted November 18, 2012 Author Posted November 18, 2012 I just needed the main numbers, didn't want the decimal or numbers after it. Looking for tutorials or information? check out: www.simpleask.co.uk
Anderl Posted November 18, 2012 Posted November 18, 2012 Who said math.floor doesn't remove decimal numbers? Examples of these functions: local number = 5.23; print( math.floor( number ) ); -- 5 print( math.ceil( number ) ); -- 6 "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
manve1 Posted November 18, 2012 Author Posted November 18, 2012 I didn't say that, but math.ceil is better for me Looking for tutorials or information? check out: www.simpleask.co.uk
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now