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? Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
Callum Posted April 19, 2010 Posted April 19, 2010 Don't know the cause, but you can use math.floor(). Retired
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