See your logic is correct but you forgot one case i guess
suppose your account is having 120 and you want to withdraw 120$ then the answer will be -0.50 which is not possible, that is your account is not having sufficient money for the transaction , so you need it add a case for that
it is mentioned in the problem statement that your account should have sufficient balance so that transaction should take place. so to do a transaction of 120 your account should hold a minimum amount of 120.50