SA-MP Forums Archive
Simple Math 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: Simple Math Problem (/showthread.php?tid=417852)



Simple Math Problem - Vlaoff - 22.02.2013

Hello guys,

I have some problem with a simple math calculation

PHP код:
new Float:price =  ((1/value)*100000);
new 
price_r floatround(pricefloatround_round) ; 
PHP код:
printf("F = %f, R = %d"priceprice_r); 
This shows "F = 0.00000, R = 0"

Whats wrong with my code ?

edit: value shows 700 if a do a printf, so it's not the problem (but it's not a float, i don't know if it matters)
edit2:

PHP код:
new Float:value_f value;
new 
Float:price =  ((1/value_f)*100000);
new 
price_r floatround(pricefloatround_round) ; 
seems to work, really strange (or not :-p )