All Projects â†’ ioquatix â†’ latinum

ioquatix / latinum

Licence: other
Latinum is a framework for resource and currency calculations.

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to latinum

currency-converter
💰 Easily convert between 32 currencies
Stars: ✭ 16 (-85.32%)
Mutual labels:  money, currencies
bank2ynab
Easily convert and import your bank's statements into YNAB. This project consolidates other conversion efforts into one universal tool.
Stars: ✭ 197 (+80.73%)
Mutual labels:  money, bank
react-local-currency
💵 💴Shows the price of your services in the customer's currency 💶 💷
Stars: ✭ 21 (-80.73%)
Mutual labels:  money, currencies
SimpleTypes
The universal PHP library to convert any values and measures (money, weight, currency converter, length, etc.).
Stars: ✭ 56 (-48.62%)
Mutual labels:  money, currencies
Nodamoney
NodaMoney provides a library that treats Money as a first class citizen and handles all the ugly bits like currencies and formatting.
Stars: ✭ 144 (+32.11%)
Mutual labels:  money, currencies
EasyMoney-Widgets
The widgets (EditText and TextView) for support of money requirements like currency, number formatting, comma formatting etc.
Stars: ✭ 91 (-16.51%)
Mutual labels:  money, currencies
Countries
Countries - ISO 3166 (ISO3166-1, ISO3166, Digit, Alpha-2 and Alpha-3) countries codes and names (on eng and rus), ISO 4217 currency designators, ITU-T E.164 IDD calling phone codes, countries capitals, UN M.49 regions codes, ccTLD countries domains, IOC/NOC and FIFA letters codes, VERY FAST, NO maps[], NO slices[], NO init() funcs, NO external links/files/data, NO interface{}, NO specific dependencies, Databases/JSON/GOB/XML/CSV compatible, Emoji countries flags and currencies support, full support ISO-3166-1, ISO-4217, ITU-T E.164, Unicode CLDR and ccTLD standarts.
Stars: ✭ 85 (-22.02%)
Mutual labels:  money, currencies
Oxr
💱 Node.js wrapper for the Open Exchange Rates API
Stars: ✭ 72 (-33.94%)
Mutual labels:  money, currencies
Django Prices
Django fields for the prices module
Stars: ✭ 135 (+23.85%)
Mutual labels:  money, currencies
Ynab Bank Importer
💰 Pull transactions from your bank and import them to YNAB automatically.
Stars: ✭ 129 (+18.35%)
Mutual labels:  money, bank
django-prices-openexchangerates
openexchangerates.org support for django-prices
Stars: ✭ 33 (-69.72%)
Mutual labels:  money, currencies
Prices
Python price handling for humans.
Stars: ✭ 248 (+127.52%)
Mutual labels:  money, currencies
stockholm
💵 Modern Python library for working with money and monetary amounts. Human friendly and flexible approach for development. 100% test coverage + built-in support for GraphQL and Protocol Buffers transports using current best-practices.
Stars: ✭ 26 (-76.15%)
Mutual labels:  money, currencies
currency-conversion
Convert Money Amounts between currencies.
Stars: ✭ 19 (-82.57%)
Mutual labels:  money, currencies
monetized
A lightweight solution for handling and storing money.
Stars: ✭ 46 (-57.8%)
Mutual labels:  money, currencies
Javamoney Lib
JavaMoney financial libraries, extending and complementing JSR 354
Stars: ✭ 104 (-4.59%)
Mutual labels:  money, currencies
Cash Cli
💰💰 Convert currency rates directly from your terminal!
Stars: ✭ 168 (+54.13%)
Mutual labels:  money, currencies
Fixer
A foreign exchange rates and currency conversion API
Stars: ✭ 2,545 (+2234.86%)
Mutual labels:  money, currencies
Jsr354 Ri
JSR 354 - Moneta: Reference Implementation
Stars: ✭ 223 (+104.59%)
Mutual labels:  money
fluxsort
A branchless stable quicksort / mergesort hybrid.
Stars: ✭ 608 (+457.8%)
Mutual labels:  stable

Latinum

Latinum is a library for resource and money calculations. It provides immutable {ruby Latinum::Resource} objects for dealing with quantities of named resources with an arbitrary number of decimal places, and {ruby Latinum::Bank} objects for converting resources and formatting them for output. Latinum doesn't include any global state by design and thus is ideal for integration with other frameworks/libraries.

Development Status

Motivation

I was originally planning on using the Money gem, but it's dependency on global state makes it hard to use if you want to deal with money as an immutable value type.

Additionally, I wanted to support BitCoin, Japanese Yen, etc. The money gem was heavily biased towards decimal currency. It had (~2012) fields like dollars and cents which don't really make sense and don't really align with the real world. These days they have fixed parts of the API, but it's a bit of a mess now, supporting both decimal and non-decimal values.

Another problem I had at the time was the concept of zero. It should be possible to have an additive (e.g. 0) and multiplicative identity (e.g. 1) do the right thing. In fact, in Latinum, you can multiply Latinum::Resource instances by a scalar and get a useful result (e.g. for computing discounts).

Finally, because of the above problem, it was not obvious at the time how to sum up a collection of money instances correctly. In fact, this is still a problem and a separate gem, based on the Latinum::Collection concept, was made. However, this all fits together in a rather haphazard way.

Latinum addresses all these issues. It has an immutable value type Latinum::Resource which has a robust definition: A value (e.g. 5.0025) and a resource name (USD). The semantics of resources are well defined without the need for "Currency" state like the symbol, how many decimal places, etc. So, it suits well for serialization into a database, and for formatting to the user, there is Latinum::Bank which gives you the choice of how you decide to format things or exchange them, whether you want to round something off, etc.

Usage

Please see the project documentation.

Contributing

We welcome contributions to this project.

  1. Fork it.
  2. Create your feature branch (git checkout -b my-new-feature).
  3. Commit your changes (git commit -am 'Add some feature').
  4. Push to the branch (git push origin my-new-feature).
  5. Create new Pull Request.

License

Copyright, 2015, by Samuel G. D. Williams.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].