Jump to content

How to get the decimals on a number?


12p

Recommended Posts

You could change your numbers to strings and then use string.format, Reffer to chapter 20 of Programming in lua by Roberto Ierusalimschy. Obviously there are less crude ways to do this, but I couldn't be bothered to find them because LUA restricts you to using the "number" type rather than giving you the conventional choice of ints/floats/doubles and so on.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...