DarkLink Posted July 8, 2012 Posted July 8, 2012 Hi there, I have a number like: "8.149461548822" and I want to only show it using 2 decimals is it possible ? like : "8.15" . is it possible ? Thanks alot in advance.
Guest Guest4401 Posted July 8, 2012 Posted July 8, 2012 https://wiki.multitheftauto.com/wiki/math.round
robhol Posted July 8, 2012 Posted July 8, 2012 Also, string.format and really quite a few different ways. When it comes to general Lua stuff, you'll usually get a quicker answer on Google, though.
DarkLink Posted July 8, 2012 Author Posted July 8, 2012 I read on google that I could use string.format, but I though it was a better way... forgot about math.round, didnt know about the second argument Thanks alot guys
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