SkatCh Posted August 25, 2014 Posted August 25, 2014 guys is there any function to convert a big number like this '10.235658946' to just two numbers '10' , i mean function like 'convertNumber'
Bonsai Posted August 25, 2014 Posted August 25, 2014 math.floor --Highest math.ceil --Lowest Actually floor, as the names says already, rounds down. Ceil, again as the name says, rounds up.
Olle Risk Posted August 26, 2014 Posted August 26, 2014 math.floor That one rounds down as said before but you also have a useful round function available: https://wiki.multitheftauto.com/wiki/Math.round In case you want to keep some of the decimals in your number, good luck.
#DRAGON!FIRE Posted August 26, 2014 Posted August 26, 2014 use math.floor or u can use string.format .
MTA Team botder Posted August 26, 2014 MTA Team Posted August 26, 2014 Or use math.modf if you want the integer part without rounding
xXMADEXx Posted August 26, 2014 Posted August 26, 2014 Uhm, those functions would be better to round to an integer, but actually there is a function called that someone wrote. https://wiki.multitheftauto.com/wiki/ConvertNumber incase you need it
Callum Posted August 26, 2014 Posted August 26, 2014 To round to an integer, simply: math.floor(number+0.5)
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