#Paper Posted February 1, 2011 Share Posted February 1, 2011 How i can transform a decimal num (23.000000502532) to a normal number? Link to comment
proracer Posted February 1, 2011 Share Posted February 1, 2011 Never used this though but you can try this. function number () local x = 23.000000502532 outputChatBox("Round number of" ..x.. "is a" ..math.round(23.000000502532)) end addEventHandler("onResourceStart", getRootElement(), number) Here is all information: https://wiki.multitheftauto.com/wiki/Math.round Link to comment
Castillo Posted February 1, 2011 Share Posted February 1, 2011 you could also use, math.floor. Link to comment
#Paper Posted February 2, 2011 Author Share Posted February 2, 2011 you could also use, math.floor. can you make an example? Link to comment
proracer Posted February 2, 2011 Share Posted February 2, 2011 You can read a bit... http://lua-users.org/wiki/MathLibraryTutorial Link to comment
Castillo Posted February 2, 2011 Share Posted February 2, 2011 uhm, i've used math.floor on getElementHealth to return a simple number, not 54.987498498789 and so on. Link to comment
Castillo Posted February 2, 2011 Share Posted February 2, 2011 Ah, ok, i'm argentinian, i don't know everything 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