11.08.2016, 00:28
(
Последний раз редактировалось Kar; 12.08.2016 в 00:42.
)
Not sure if reported before:
Seeing that NEARLY everyone is misunderstanding the code for what reason I DON'T understand.
Here:
First set a test float variable Float:fTest to 97.10;
Use printf/format and print the variable.. it will print 97.09.
I found a workaround for anyone who wants this fixed, and they use the MySQL plugin.. they may use mysql_format to make it print 97.10 successfully.
pawn Код:
CMD:changefloat(playerid, params[])
{
new Float:fTest = 97.10, szStr[64];
printf("printf:: fTest is %.2f.", fTest); // result: "printf:: fTest is 97.09."
format(szStr, 64, "fTest is %0.2f.", frequency);
SendClientMessage(playerid, -1, szStr); // result: "fTest is 97.09."
mysql_format(mysqlConnHandle, szStr, 64, "fTest is %0.2f.", frequency); // workaround at https://github.com/pBlueG/SA-MP-MySQL/bl...g.cpp#L963 for whoever uses this plugin
SendClientMessage(playerid, -1, szStr); // result: "printf:: fTest is 97.10."
return 1;
}
Here:
First set a test float variable Float:fTest to 97.10;
Use printf/format and print the variable.. it will print 97.09.
I found a workaround for anyone who wants this fixed, and they use the MySQL plugin.. they may use mysql_format to make it print 97.10 successfully.