dzek (varez) Posted April 19, 2010 Posted April 19, 2010 im getting float from database.. its 4.0 for example then im triggering client event and sending that value on client im doing tostring and putting in into grid ceil ... and it is like 4.0000003 the question is: WHY?
Callum Posted April 19, 2010 Posted April 19, 2010 Don't know the cause, but you can use math.floor().
Antibird Posted April 19, 2010 Posted April 19, 2010 Because of this: http://en.wikipedia.org/wiki/Floating_point But saying shortly, using round functions helps in many cases.
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