FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: change input type from int to float in currency converter by harshitbanaula · Pull Request #134 · codedex-io/python-101 · GitHub

fix: change input type from int to float in currency converter - #134

Open
harshitbanaula wants to merge 1 commit into
codedex-io:mainfrom
harshitbanaula:#127
Open

fix: change input type from int to float in currency converter#134
harshitbanaula wants to merge 1 commit into
codedex-io:mainfrom
harshitbanaula:#127

Conversation

Copy link
Copy Markdown

What this PR does

  • Changes input types from int to float for pesos, soles, and reais.
  • Allows decimal values in the currency converter.

Why

Previously, the code only accepted whole numbers. This caused incorrect behavior if the user entered decimals.

Example

Input:

  • pesos = 100.5
  • soles = 50.25
  • reais = 30.75

Output:

  • total = 17.04875

Copy link
Copy Markdown
Author

Changed input types from int to float so decimal amounts are accepted in currency conversion.

Copy link
Copy Markdown

What this PR does

  • Changes input types from int to float for pesos, soles, and reais.
  • Allows decimal values in the currency converter.

Why

Previously, the code only accepted whole numbers. This caused incorrect behavior if the user entered decimals.

Example

Input:

  • pesos = 100.5
  • soles = 50.25
  • reais = 30.75

Output:

  • total = 17.04875

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL