No project description provided
Project description
Format Numbers as Currencies
A no-frill currency formatting library.
Table of Contents
Installation
pip install format-currency
Usage
from format_currency import format_currency
# format currency by country code, using the selected country's local monetary number formatting
formatted = format_currency(1234567.89, 'US') # returns $ 1,234,567.89
formatted = format_currency(1234567.89, 'ID') # returns Rp 1.234.567,89
#format currency by currency code
formatted = format_currency(1234567.89, currency_code='USD') # returns $ 1,234,567.89
formatted = format_currency(1234567.89, currency_code='IDR') # returns Rp 1.234.567,89
# format currency by country code, respecting global locale settings
import locale
locale.setlocale(locale.LC_ALL, '')
formatted = format_currency(1234567.89, 'US', use_current_locale=True) # returns $ 1,234,567.89
formatted = format_currency(1234567.89, 'ID', use_current_locale=True) # returns Rp 1,234,567.89
License
format-currency
is distributed under the terms of the MIT license.
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
format_currency-0.0.1.tar.gz
(165.7 kB
view hashes)
Built Distribution
Close
Hashes for format_currency-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b62b16349f61bc20b6b913dc2f875f0c0a16a815f9c751467df4ad866527cab6 |
|
MD5 | 88044a71cd4ddc633d4ad9eb0110d61e |
|
BLAKE2b-256 | 9bb40c3f0d80cc57c0e5da198c9fcd3ea189636ce38c9789478815f5a84fb816 |