Skip to content

Commit 99c783f

Browse files
author
ravigadila
committed
Force decimal documentation added in README.rst
1 parent 6a45e51 commit 99c783f

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

README.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,30 @@ Usage Examples:
8686
>>> c.convert('USD', 'INR', 10)
8787
674.73
8888
89+
- Force use of Decimal
90+
91+
.. code-block:: python
92+
93+
python
94+
>>> from forex_python.converter import CurrencyRates
95+
>>> c = CurrencyRates(force_decimal=True)
96+
>>> c.convert('USD', 'INR', Decimal('10.45'))
97+
705.09
98+
>>> c.convert('USD', 'INR', 10)
99+
DecimalFloatMismatchError: convert requires amount parameter is of type Decimal when use_decimal=True
100+
101+
- Detect use of Decimal
102+
103+
.. code-block:: python
104+
105+
python
106+
>>> from forex_python.converter import CurrencyRates
107+
>>> c = CurrencyRates()
108+
>>> c.convert('USD', 'INR', Decimal('10.45'))
109+
705.09
110+
>>> c.convert('USD', 'INR', 10)
111+
674.73
112+
89113
- Get latest Bitcoin price.
90114

91115
.. code-block:: python

forex_python/bitcoin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def convert_btc_to_cur_on(self, coins, currency, date_obj):
132132

133133
def get_symbol(self):
134134
"""
135-
Here is Unicode symbol for bit coin
135+
Here is Unicode symbol for bitcoin
136136
"""
137137
return "\u0E3F"
138138

0 commit comments

Comments
 (0)