SkatCh Posted August 25, 2014 Share 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' Link to comment
Et-win Posted August 25, 2014 Share Posted August 25, 2014 math.floor --Highest math.ceil --Lowest Link to comment
Bonsai Posted August 25, 2014 Share 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. Link to comment
Et-win Posted August 25, 2014 Share Posted August 25, 2014 Oops, I never remember them (English ) Link to comment
Olle Risk Posted August 26, 2014 Share 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. Link to comment
#DRAGON!FIRE Posted August 26, 2014 Share Posted August 26, 2014 use math.floor or u can use string.format . Link to comment
MTA Team botder Posted August 26, 2014 MTA Team Share Posted August 26, 2014 Or use math.modf if you want the integer part without rounding Link to comment
xXMADEXx Posted August 26, 2014 Share 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 Link to comment
Callum Posted August 26, 2014 Share Posted August 26, 2014 To round to an integer, simply: math.floor(number+0.5) Link to comment
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