25.12.2013, 18:49
You dont need floatround, integer multiplication is enough
But if you only use integer you always should multiply first
Even if you wanted to use floats the correct way would be
But if you only use integer you always should multiply first
pawn Код:
new
bizTax = gStats[govPercentageBiz],
currentBizPrice = eStats[i][bizPrice]
;
currentBizPrice = (currentBizPrice * bizTax) / 100; // or just without brackets
pawn Код:
new
bizTax = gStats[govPercentageBiz],
currentBizPrice = eStats[i][bizPrice]
;
currentBizPrice = floatround((currentBizPrice * (bizTax / 100.0))); // notice the .0, otherwise it's just a integer division