AncienT Posted August 1, 2018 Posted August 1, 2018 (edited) There is some way to convert any rounded quantity from 5 to 5 for example the amount 893 that rounds to 895 or de quantity 562 is rounded to 560 Edited August 1, 2018 by AncienT
Moderators IIYAMA Posted August 1, 2018 Moderators Posted August 1, 2018 (edited) 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 August 1, 2018 by IIYAMA 1
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