Welcome Guest, Not a member yet? Register   Sign In
how to store pricing (anyone have any helpers for price data?)
#11

[eluser]stommert[/eluser]
There is a reason why most payment providers deal with integers and not decimal values. If you think about it, calculating with integers is by far a better idea than calculating with decimals.
1. you are forced to round your calculations at the end.
2. php is weak typed. so calculating with decimals is a bad idea.
3. payment providers like ogone, ideal (in the netherlands) etc. only accept integer values.

I don't have to repeat why floating point values are very, very, very bad for exact values like money.

I hope I have convinced everyone about using cents (integers) for money issues. As I stated before, it saves you a lot of headache




Theme © iAndrew 2016 - Forum software by © MyBB