So for example i'm selling 3 items [already stored this in mySQL/Database] each item has a value of $100 and the total money of the client is $500 i want to do the calculation using PHP script. So it will subtract the $300 into the client's money which is $500. So the total exchange is $200..
So now, i can do this in PHP in manual way but how about let the PHP do the job.
Like i'll buy 6 items or so, and enter the total money i got. It will subtract automatically and tells me how much do i owe and how much do i get back.
It's more like buying stuffs in a supermarket, paying it, giving you receipt.
Total amount of what did you bought:
Total exchange:
Total money:
Let me know if the explanation is so much complicated and thanks in advance.
Question
simplynice
Good day guys, i just want to ask about PHP math.
I don't have any idea what to do with this stuff.
So for example i'm selling 3 items [already stored this in mySQL/Database] each item has a value of $100 and the total money of the client is $500 i want to do the calculation using PHP script. So it will subtract the $300 into the client's money which is $500. So the total exchange is $200..
So now, i can do this in PHP in manual way but how about let the PHP do the job.
Like i'll buy 6 items or so, and enter the total money i got. It will subtract automatically and tells me how much do i owe and how much do i get back.
It's more like buying stuffs in a supermarket, paying it, giving you receipt.
Total amount of what did you bought:
Total exchange:
Total money:
Let me know if the explanation is so much complicated and thanks in advance.
Link to comment
Share on other sites
5 answers to this question
Recommended Posts