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' Failure is simply an opportunity to begin again more intelligently - Henry Ford
Et-win Posted August 25, 2014 Posted August 25, 2014 math.floor --Highest math.ceil --Lowest ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
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.
Et-win Posted August 25, 2014 Posted August 25, 2014 Oops, I never remember them (English ) ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
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. function be_remove() { printf("Too much gaming and too little sleep makes Olle wanna kill..."); be_remove(); }
#DRAGON!FIRE Posted August 26, 2014 Posted August 26, 2014 use math.floor or u can use string.format . To Contact Me at Skype : [email protected]
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 GitHub: Debug Console • MTA-Discord Relay Scripting: How to draw a line chart with DirectX functions? • Doppler Effect in MTA • Get the client's FPS • Customizable Blur Shader
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 The Ultimate Lua Tutorial! | MTA PHP SDK
Callum Posted August 26, 2014 Posted August 26, 2014 To round to an integer, simply: math.floor(number+0.5) Retired
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