SA-MP Forums Archive
multiply an int with float[problem] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: multiply an int with float[problem] (/showthread.php?tid=464981)



multiply an int with float[problem] - No Fear - 20.09.2013

Hi, every time i try to multiply a number by a float, i get big numbers, fox example new Float:floatvar=2.5; 1000*varforfloat. How can i fix this?


Re: multiply an int with float[problem] - Macluawn - 20.09.2013

Convert the integer into a float.


Re: multiply an int with float[problem] - No Fear - 20.09.2013

Doesn't help.


Re: multiply an int with float[problem] - Dragonsaurus - 20.09.2013

pawn Код:
printf("%d x %.3f = %.3f", integer, float, integer*float);



Re: multiply an int with float[problem] - No Fear - 20.09.2013

Yeah it works, but i need to use this code in GivePlayerMoney, and how about now? i can't use "%f"


Re: multiply an int with float[problem] - Dragonsaurus - 20.09.2013

Use
pawn Код:
GivePlayerMoney(playerid, floatround(int*float));