Jump to content

Another help please


Snaik

Recommended Posts

  
local n = tonumber(string.format("%.2f", 9/7)) 
-- n == 1.29 
  

PS: if you dont need it as a number for further calculations (like if you're just going to display it somewhere), you can drop tonumber().

but keep in mind that it will add zeros to integers (like 9/9 will result in 1.00 without tonumber)

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...