22.05.2011, 22:01
I have a savings account system, and every payday you earn 0.3% interest rate. What happens if it gets a decimal considering money doesn't have cents (in this mode atleast)? Is there a mathematical function to round a number to the nearest whole number in PAWN? If so, what is it, and can you give me an example using this code?
pawn Код:
if(PVar[i][BankSavings] != 0) {
if(PVar[i][BankSavings] != 5000) {
PVar[i][BankSavings] += PVar[i][BankSavings]*0.3; //Here is where I would like to round it.
}
else return SendClientMessage(i, -1, "{55FF00}[Bank]{FFFFFF} You have $5,000 and cannot earn any more! Please withdraw your balance from your savings account!");
}