A mathematical function to round?
#1

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!");
        }
Reply


Messages In This Thread
A mathematical function to round? - by Skylar Paul - 22.05.2011, 22:01
Re: A mathematical function to round? - by Austin - 22.05.2011, 22:10
Re: A mathematical function to round? - by admantis - 23.05.2011, 00:31

Forum Jump:


Users browsing this thread: 1 Guest(s)