01.05.2014, 21:23
pawn Код:
CalculateTax(amount, Float:percentage)
{
new cash;
cash = (amount / 100) * percentage;
return cash;
}
30.5% is it possible?
CalculateTax(amount, Float:percentage)
{
new cash;
cash = (amount / 100) * percentage;
return cash;
}
CalculateTax(amount, Float:percentage)
{
return amount / 100 * percentage;
}
CalculateTax(amount, Float:percentage)
{
new Float:cash;
cash = (amount / 100) * percentage;
return floatround(cash, floatround_round);
}
remove the () around amount/ 100 so it will be:
pawn Код:
|
CalculateTax(amount, Float:percentage)
return (amount / 100) * (_:percentage);
It compiled properly because you did not use the function but try using it and you will get mismatch tag.
Anyways I don't get why the warning occurs on Floatercentage anyways you don't need to declare a new variable you can do it like this. pawn Код:
@Marricio - Try using the function you wrote, it prints 0.0 |