09.07.2016, 20:21
Don't forget that the result is a floating-point number so round its value downwards.
You can also multiply it with 0.05 directly to avoid division. For your example, the paycheck is 45 so the 5% of it is 2.25 which makes GeneralTax to be 2.
pawn Код:
GeneralTax = floatround(PayCheck * 0.05, floatround_floor);