Per cent calculation
#1

Hi, i've tried with several methods but i've NEVER to calculate a percentage on SAMP. For example if I want to find 30% of 15 i find 0.

Here is one of the method I used:
pawn Код:
new Float: caution = CarInfo[car][cPrice]*0.3;
printf("%d. %0.1f.", CarInfo[car][cPrice], floatround(caution)); //cPrice = 15 and floatround(caution) = 0 where it should be 4.5
Any help?
Reply


Messages In This Thread
Per cent calculation - by Coicatak - 19.12.2009, 17:33
Re: Per cent calculation - by BeckzyBoi - 19.12.2009, 17:35
Re: Per cent calculation - by Joe Staff - 19.12.2009, 18:28
Re: Per cent calculation - by Coicatak - 19.12.2009, 18:44
Re: Per cent calculation - by Coicatak - 19.12.2009, 22:20
Re: Per cent calculation - by Coicatak - 19.12.2009, 22:45
Re: Per cent calculation - by DiddyBop - 19.12.2009, 23:43
Re: Per cent calculation - by Joe Staff - 20.12.2009, 00:46
Re: Per cent calculation - by Balon - 20.12.2009, 08:39
Re: Per cent calculation - by 1D10T - 24.01.2011, 14:40

Forum Jump:


Users browsing this thread: 2 Guest(s)