MySQL Coordinates issue
#1

My house system is a bit buggy because the X,Y,Z coordinates don't save properly in MySQL field..
0 at the end is being deleted, sometimes last two digits..
I have tried using FLOAT or DOUBLE, nothing works

Any help would be appreciated
Reply
#2

"Am I supposed to guess your code?"
Reply
#3

Quote:
Originally Posted by KayJ
Посмотреть сообщение
"Am I supposed to guess your code?"
It's not the problem in code i think
If I manually enter "6404.930664" in MySQL field, it becomes "6404.93"
Reply
#4

It is saving properly, its rounding the decimal numbers.
Reply
#5

Quote:
Originally Posted by Treyvan
Посмотреть сообщение
It is saving properly, its rounding the decimal numbers.
But when I load the house, it's not in the right place, it moves away and down a bit
Reply
#6

You probably need to specify to what length the decimals go in the MySQL field itself.

You will need to submit some code anyway, as we need to check the storage/obtaining of the coords.

Could be an idea to show some of the settings for that field in the DB.
Reply
#7

Well its not the script causing it, its mySQL.

If you need the coordinates to be that exact change the field type on the x y z rows on the table to decimal, and be sure to set the decimal length to match what your looking for, you can also try changing the decimal value while the table is set to float it may give the same result. I haven't tried this on my server because I didn't see it as a problem lol.

Anyway for more information on this issue you can check the mysql manual article here for this issue. It may not be your sql version but it does try to help you understand whats going on.
Reply
#8

^^ Yea, this is the sort of thing I was hinting towards.
Reply
#9

If I change it to decimal, then it doesn't support dot so it could only be 6404 instead of 6404.930664 although I increased the length to match it.. Changing decimal value while table is set to float seems not to be possible

It is not my MySQL version for sure, I tried different one already

Yeah, I need exact coordinates because it's a house position heh
Reply
#10

bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)