MySQL - Floats rounding up/down
#1

Hey guys

Iґve got a small problem with MySQL, I can read and set floats in the DB, but it always is rounding up/down itself.
I couldnt find a fix yet, does someone know how to fix it?

PHP код:
public OnPlayerDisconnect(playeridreason)
{
    new 
Query[256];
    
GetPlayerPos(playeridpInfo[playerid][posX], pInfo[playerid][posY], pInfo[playerid][posZ]);
    
mysql_format(mysqlQuerysizeof(Query), "UPDATE accounts SET Score='%d', VIP='%d', Money='%d', PosX='%f', PosY='%f', PosZ='%f' WHERE ID='%d'",
    
pInfo[playerid][Score], pInfo[playerid][VIP], GetPlayerMoney(playerid), pInfo[playerid][posX], pInfo[playerid][posY], pInfo[playerid][posZ], pInfo[playerid][ID]);
    
printf("%s"Query);
    
mysql_tquery(mysqlQuery"""");
    return 
1;

PHP код:
    pInfo[playerid][posX] = cache_get_field_content_float(0"PosX");
    
pInfo[playerid][posY] = cache_get_field_content_float(0"PosY");
    
pInfo[playerid][posZ] = cache_get_field_content_float(0"PosZ");
    
pInfo[playerid][FacingAng] = cache_get_field_content_float(0"FacingAngel"); 
Reply


Messages In This Thread
MySQL - Floats rounding up/down - by Saize - 04.02.2015, 18:36
AW: MySQL - Floats rounding up/down - by Saize - 04.02.2015, 18:45
AW: MySQL - Floats rounding up/down - by Saize - 04.02.2015, 19:00
Re: MySQL - Floats rounding up/down - by Vince - 04.02.2015, 19:35
AW: Re: MySQL - Floats rounding up/down - by Saize - 04.02.2015, 19:37
Re: MySQL - Floats rounding up/down - by PowerPC603 - 04.02.2015, 20:20
AW: Re: MySQL - Floats rounding up/down - by Saize - 04.02.2015, 20:22
AW: MySQL - Floats rounding up/down - by Saize - 05.02.2015, 23:11
Re: MySQL - Floats rounding up/down - by Maximus0 - 05.02.2015, 23:50
AW: MySQL - Floats rounding up/down - by Saize - 06.02.2015, 06:45

Forum Jump:


Users browsing this thread: 1 Guest(s)