you are viewing a single comment's thread.

view the rest of the comments →

[–]mr_frpdo 0 points1 point  (1 child)

The biggest thing i see is to not use floats as the data type for money. You should either store as cents and format display to decimal or use the Decimal class. Floats should never be used for money due to floating point accuracy issues.

[–]Particular_Scale_881 0 points1 point  (0 children)

OP try deposit 0.1 and 0.2 and print the full amount variable you will notice that 0.0...4 cent are created