Jump to content

[HELP]Round Amount


AncienT

Recommended Posts

  • Moderators
math.floor(value / 10 + 0.5) * 10

This round based on 10. (Inspiration)

__________________________________

 

Experimental

local value = 342

local restValue = value % 5

print(restValue)

if restValue > 2.5 then
value = value + 5 - restValue
else
value = value - restValue
end

print(restValue)



print(value)

 

Edited by IIYAMA
  • Thanks 1
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...