| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Changed int(input()) to float(input()) for all currency inputs to properly handle decimal values. Currency amounts can have fractional values (e.g., 10.50), so using float() instead of int() prevents data loss from truncation. Fixes codedex-io#127
| Back | FazBrowse Home | New Git URL |
Summary
Fixed the currency converter to properly handle decimal values by changing int(input()) to float(input()) for all three currency inputs (pesos, soles, reais).
Problem
The original code used int(input()) which truncates decimal places, causing incorrect calculations when users input currency amounts with cents (e.g., 10.50 would become 10).
Solution
Test Results
Tested with inputs: 100.50 pesos, 200.75 soles, 150.25 reais
Expected result: 87.787625
Actual result: 87.787625 ✅
Fixes #127