My payment system takes 0.5% from each transaction. I have 0.9$ on my account, very small amount. And when I try to withdraw 0.9$ through API it gives an error, it takes 0.0045$ as fee and rounds to 0.91$. So I can only withdraw 0.89$ and pay 0.00445$ fee, which is rounded to 1 cent to empty my account;
I can't understand by which formula the additional fee is rounded =(
php round(0.9+0.9*0.005,2)
returns 0.9$, how to get 0.91$?
Edit: ceil works good for this particular amount, but on practice when I withdraw only 1 cent the comission, which is 0.00005 somehow does not count as 0.01, looks like besides ceil() only first two zeros after point are included. hm..
ceil((0.01*0.005) * 100) / 100; gives 1 cent, but in reality api takes zero.