I found the reference to "- 1%" to be confusing. At first I was trying to take 1% of the remaining balance.
This sentence made it clear:
"+ 1% from the withdrawn cash plus the robots cannot go beyond the card’s balance."
Perhaps the comments in the code can be updated to reflect this such as:
120 - 10 - 0.5 - 1% (10 * 0.01) = floor(109.4) = 109
Created at: 2012/12/18 15:13; Updated at: 2013/09/30 13:46