UNKNOWN
Project description
A simple interface to work with money-related entities.
Installation
The current stable release:
pip install simple_money
or:
easy_install simple_money
or from source:
$ sudo python setup.py install
Usage
Arithmetic operations:
>>> Money(100, 'EUR') + Money(50, 'EUR')
150 EUR
>>> Money(100, 'EUR') - Money(50, 'EUR')
50 EUR
>>> Money(100, 'EUR') * 2
200 EUR
Also you can manipulate with money in different currencies:
>>> Money(100, 'EUR') + Money(50, 'USD')
100 EUR, 50 USD
>>> Money(100, 'EUR') - Money(50, 'USD')
100 EUR, -50 USD
>>> (Money(100, 'EUR') - Money(50, 'USD')) * 2
200 EUR, -100 USD
With multiply currencies you are able to get concrete currency value in the following way:
>>> value = Money(100, 'EUR') + Money(50, 'USD')
>>> value.EUR
100 EUR
>>> value.USD
50 EUR
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
simple-money-0.1.1.tar.gz
(4.2 kB
view hashes)
Built Distribution
Close
Hashes for simple_money-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df1a914f4d06e9a135fb132011bd7a03ac897c66e5fc653fbd65ed74c6a1174d |
|
MD5 | 36f841d488ffacf5decd0070376df74b |
|
BLAKE2b-256 | 18f6df7868a92cb686437cd7331777485e6120c0477b01f873f7ce3fa678587e |