A currency formatter for many currencies
Project description
Currencies Formatter
The Currencies Formatter Library (or currencies lib) is a Python library designed to simplify the formatting of monetary values for various currencies. It supports a wide range of currencies and provides options for custom formatting. Whether you need to display values with currency symbols or abbreviate large numbers, this library offers a straightforward solution.
Features
- Format monetary values for a variety of currencies.
- Customizable formatting options for currency symbols and decimal places.
- Supports both standard and custom currency symbols.
- Allows conversion of values to percentage format.
- Utility functions for abbreviating units and detecting currency symbols.
Installing
You can install this library with:
$ pip install currencies-lib
Example of use
from currencies_lib import BRL
value = 1250.50
result = BRL(value, currency_symbol=True)
print(result)
#> "R$ 1.250,50"
or
from currencies_lib import *
value = 1250.50
result = Currency_Formatter.EUR(value, currency_symbol=True, eur_sign=True)
print(result)
#> "€ 1.250,50"
Note: Direct imports from the currencies_lib module are not recommended. Use from currencies_lib import ... to access specific formatters or all of them "*".
Contributing
I welcome contributions to improve this library! If you have suggestions, bug reports, or new feature requests, please open an issue or submit a pull request on my GitHub repository.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for currencies_lib-1.0.3-py3-none-any.whl
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | ff9ea418c2943eceae01ccdb3da70c6fa00634c198ceffff33f433f9f7da1a07 |
|
| MD5 | 4f58d0ec32f047f696006c42ba732eb6 |
|
| BLAKE2b-256 | a4fac634bd55849827a639e6127a7e096aa962df58e59ea62fcb4c83da13ce3c |