Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 21d91bd

Browse files
authored
Merge pull request shrey141102#132 from supr1yo/currency-converter
[KWoC] Update: Currency converter
2 parents a9ea4e7 + e434ae7 commit 21d91bd

File tree

4 files changed

+21
-1
lines changed

4 files changed

+21
-1
lines changed

CurrencyConverter/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Currency Converter
2+
>💰 A command-line tool written in Python to convert between currencies.
3+
4+
<div align='center'>
5+
<img src='./screenshot.png'>
6+
</div>
7+
8+
## ISO codes
9+
A list of Country currency codes can be found <a href='https://www.iban.com/currency-codes' target='_blank'>here.</a>
10+
11+
## Installation
12+
1. Download the folder `CurrencyConverter`
13+
2. Run the command to install dependencies
14+
```:
15+
pip install -r requirements.txt
16+
```
17+
3. Execute the main file
18+
```
19+
py main.py
20+
```

CurrencyConverter/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def convert_currency_with_api(amount, from_currency, to_currency, api_key):
2323
if exchange_rate is not None:
2424
converted_amount = amount * exchange_rate
2525
result = (
26-
f"{amount} {from_currency} is equal to {converted_amount} {to_currency}"
26+
f"{amount} {from_currency} is equal to {round(converted_amount, 2)} {to_currency}"
2727
)
2828
return result
2929
else:

CurrencyConverter/requirements.txt

188 Bytes
Binary file not shown.

CurrencyConverter/screenshot.png

4.01 KB
Loading

0 commit comments

Comments
 (0)