C# HTML PowerShell
Latest commit 85c2c06 Aug 22, 2017 @dgg fix license url
Permalink
Failed to load latest commit information.
.nuget Upgrade libraries, tools and build process Jul 20, 2016
build constrain upper version for legacy serialization Jun 21, 2017
lib fixed ScrapeWebsite feature in order to scrape the Excel sheet with c… Mar 8, 2011
packages upgrade Bson package version to one that supports Decimal128 type Jun 19, 2017
src Add trailing dot to DKK symbol. Fixes 51 Aug 16, 2017
tools missing tools due to silly .gitignore Apr 20, 2017
.gitignore missing tools due to silly .gitignore Apr 20, 2017
LICENSE update license from MIT to BSD Aug 22, 2017
NMoneys.Demo.sln Article for CodeProject about NMoneys.Exchange Sep 25, 2011
NMoneys.Exchange.nuspec fix license url Aug 22, 2017
NMoneys.Serialization.Entity_Framework.nuspec fix license url Aug 22, 2017
NMoneys.Serialization.Json_NET.nuspec fix license url Aug 22, 2017
NMoneys.Serialization.Mongo_DB.nuspec fix license url Aug 22, 2017
NMoneys.Serialization.Mongo_DB_legacy.nuspec fix license url Aug 22, 2017
NMoneys.Serialization.Raven_DB.nuspec fix license url Aug 22, 2017
NMoneys.Serialization.Service_Stack.nuspec fix license url Aug 22, 2017
NMoneys.Tools.sln Commit of baseline for v1.0 after repository reset Oct 25, 2010
NMoneys.key.snk add key pair in order to stringly type NMoneys.dll and add build targ… Jun 19, 2014
NMoneys.nuspec fix license url Aug 22, 2017
NMoneys.sln migrated nmoneys.exchange Apr 19, 2017
README.md add codecov badge Aug 3, 2016
build.ps1 before and after CI build scripts Jul 13, 2015

README.md

logo

Implementation of the Money Value Object to support representing moneys in the currencies defined in the ISO 4217 standard

Build status Coverage Status codecov

What

NMoneys (plural) is a simple .Net library to represent monetary quantities.

What does NMoneys provide?

  • types for representing currencies that conform to the ISO 4217 standard and quantities of money in a given currency.
  • simple but extensible operations with monetary quantities of the same currency, including allocations of several sorts.
  • ways of formatting the representation of monetary quantities
  • a simple way of contributing to improve the completeness and correctness of the library

What not

NMoneys does not provide any support for exchanging monetary quantities in different currencies. That means that you could not "convert", for example, 10 Euro into the equivalent quantity in dollars using an internal exchange rate in the library. Instead, you could, for example, perform the conversion with numeric types and then display the resultant quantity in a meaningful way by using types provided by NMoneys.

If you need to convert monetary quantities into other currencies you can use the framework provided by NMoneys.Exchange alongside your trusted currency rates feed.

NMoneys does not provide, as of now, complex monetary or financial operations

What might

The aim of NMoneys is being simple and to-the-point: represent monetary quantities.

But, one of the reasons of making it Open-Source is that people with knowledge in the areas related with the subject of the library, that is money, can contribute with correct and useful ways to operate with the concepts in the library without cluttering its original purpose.

Why

The .NET Framework

.Net does not provide a good way of representing and operating with monetary quantities. Nonetheless, it does support numeric types that can be used to represent monetary quantities and it also provides support for formatting those numeric values in different cultures. But it is surprisingly easy to mix the concept of "10 represented euros when was saved" with "now, 10 represents something else because of the current culture of the thread".

The .Net Framework mixes numbers, currencies, cultures and formats in a way that it becomes confusing, difficult and/or impossible to represent something as simple as "one Euro" or "ten-and-the-half Zambian kwacha".

On top of that mixture of concepts, it does not support a complete implementation for the ISO standard and for the subset implemented, the information may be outdated or even wrong. Fixes might be issued for wrong/outdated data, but they may take too long to be rolled-out and to add further confusion currency formatting information can be modified by the user.

Other libraries

There might be others libraries or simple code snippets that might cover a necessity. But they did not cover mine for one or another reason: different goals, lack of activity/outdated, not suitable API,...

Open source

I have been using different incarnations of this library in commercial projects for some time now. It started with a limited set of well-known currencies. Then it grew to include some others until I decided to support all ISO currencies. At that point I realised that there was no way I could support correctly all scenarios for multiple reasons:

  • lack of cultural knowledge (e.g. how does one represent decimals in Swaziland?)
  • lack of technical knowledge (e.g how does one distribute an amount of money amongst a number of parties?)

With the realisation came the proposal to my employer to Open-Source the library and modify it so that is easy enough for people to help out, even if they are not .Net programmers.

And here we are.