SA-MP Forums Archive
Problem with Maths in Pawno ( Not whole Numbers ) - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem with Maths in Pawno ( Not whole Numbers ) (/showthread.php?tid=123885)



Problem with Maths in Pawno ( Not whole Numbers ) - silvan - 27.01.2010

Well i'm trying to make a number * 1.5
and with it its giving me a warning and if i do whole number such as * 2 it work fine. Is there a way how to fix it? anyways here's the code.

Code that gave me warning:
Код:
interest = bankmoney * 1.5;
Code that worked absulutely fine:
Код:
interest = bankmoney * 2;
Warning by Pawno when using Decimal Numbers:
Код:
D:\Program Files\Rockstar Games\GTA San Andreas\0.3 server\gamemodes\mrp.pwn(3893) : warning 213: tag mismatch
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
I want to make it with 1.5 how can i do it?



Re: Problem with Maths in Pawno ( Not whole Numbers ) - dice7 - 27.01.2010

1.5 is a float and you can only multiply floats with floats
pawn Код:
new Float:bankmoney;
new Float:interest = bankmoney * 1.5;