Giter Club home page Giter Club logo

nmoneys's People

Contributors

brantburnett avatar dgg avatar itdev41k avatar mexx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

nmoneys's Issues

Add to package management

As an effort to popularize the library, packages for the current packaging 
systems in .NET:
 * Openwrap
 * Nu
 * NuPack
 * HornGet
 * CoApp
 * whichever one you request

Original issue reported on code.google.com by [email protected] on 25 Oct 2010 at 9:22

Finite denominations when making optimal change

MakeOptimalChange() works under the premise that the set of denominations that is passed is infinite, that is, we never "run out" of pieces for each denomination.

In the real-world, there is only a finite amount of pieces of each denomination. Change the algorithm (and change Denomination as well) or create another method (taking, for instance a collection of FiniteDenominations) to support this real-world scenario.

Allow Json deserializer to accept decimal

It would be great if the Json.net deserializer could accept a standard decimal 
(float) value and make it into a Money data type with currency XXX. It would 
help getting data from existing services.

Suggested code:
            var token = JToken.ReadFrom(reader);

            if(!token.HasValues)
            {
                decimal value;
                if (!decimal.TryParse(token.ToString(), out value))
                    throw new ArgumentException("Invalid content");

                return new Money(value);
            }

            return new Money(
                readAmount(token),
                readCurrency(token));

Original issue reported on code.google.com by [email protected] on 12 May 2014 at 10:59

reference type (class) implementation of NMoneys?

Are there any plans to release a version of NMoneys implemented as a class and not a struct.
This would be really useful for using Money in Entity Framework applications.

Entity Framework does not support structs, only classes as a complex type columns.

Change how money is formatted for CVE

While doing some research for the Ammendment 159, I discovered that CVE moneys 
are not to be formatted with a symbol.

So 12.25 CVE should be formatted as 12$25 and not $12$25.


Original issue reported on code.google.com by [email protected] on 1 Sep 2014 at 1:50

Multiplication and division with decimals

I don't found support for multiplication and division for decimal numbers.
For example I would like to use something like var valueOfSmth = price * 1.3; where price is Money.

Is it intentionally not implemented or it is good feature to implement?

Handle null in operators

As Money is now a class, nulls need to be handled in operator and arithmetics 
operations arguments

null + something = something
something + null = something
null + null = null
m.Add(null) = m

null - something = -something
something - null = something
null - null = null
m.Substract(null) = m

null * something = null
something * null = null
null * null = null

-null = null
...



Original issue reported on code.google.com by [email protected] on 2 Jul 2010 at 6:30

Finite denominations when making change

MakeChange() works under the premise that the set of denominations that is passed is infinite, that is, we never "run out" of pieces for each denomination.

In the real-world, there is only a finite amount of pieces of each denomination. Change the algorithm (and change Denomination as well) or create another method (taking, for instance a collection of FiniteDenominations) to support this real-world scenario.

Deserialization of deprecated currencies

Currencies are volatile, new currencies get added and old ones get substituted.
Currencies and moneys can be serialized somehow.


What steps will reproduce the problem?
1. have an old deprecated currency serialized
2. try to deserialize
3. the object can't be reconstructed

Explore the options to intercept the de-serialiation process.


Original issue reported on code.google.com by [email protected] on 25 Oct 2010 at 12:58

.Net Core

Hallo, i can not use NMoneys in .NET Core project. When is extension provided?

Incorrect allocation by ratios

Hi!
That is a cool library, thanks for your time to develop it and make others life easier:)

While integrating it into my project I've found wrong allocation using ratios:
10m.Usd().Allocate(new RatioCollection(1m, 0m));
Expected result: 10m & 0m
Act result: 10.01m & -0.01m
NMoneys version: 6.1.0

Seems the problem is in Currency.Round method in MidpointRounding value.

internal decimal Round(decimal share)
{
	decimal raw = share - (.5m * MinAmount);
	decimal rounded = Math.Round(raw, SignificantDecimalDigits, MidpointRounding.AwayFromZero);
	return rounded;
}

Thanks in advance.

README.md says "ISO 4417" instead of "ISO 4217"

Readme of the project has 2 different ISO numbers, but I guess is just a misspell and they should be the same. There is only 1 digit difference. And ISO 4417 seems to be about cloth sizes.

Demo project

In order to facilitate the approach for non-developers it would be advantageous 
if the project had a desktop executable that showed-off the features of the 
library.
A simple WPF application would do the work.

Original issue reported on code.google.com by [email protected] on 28 Oct 2010 at 7:04

Don't do ExchangeConversion if from and to currency codes are the same

Just spotted that the ExchangeConversion class will instantiate a new Money 
even if the target currencyCode is the same as the source currencyCode.  Could 
this be optimized like this:

public Money To(CurrencyIsoCode to)
{
    if (_from.CurrencyCode == to)
        return _from;

    ExchangeRate rate = _provider.Get(_from.CurrencyCode, to);
    return rate.Apply(_from);
}

Original issue reported on code.google.com by [email protected] on 10 Sep 2012 at 8:29

Add historical currencies

Now that the information is easily available and a estrategy for obsolete 
currencies is in place, historical currencies can be added to the library from 
http://www.currency-iso.org/dl_iso_tables_a3.xls


Original issue reported on code.google.com by [email protected] on 9 Mar 2011 at 12:00

Parsing always uses target currency NumberFormatInfo

What steps will reproduce the problem?

1. Execute the following code in an en-US or en-GB context. 
2. Console.WriteLine(Money.Parse("€1000.00", Currency.Eur));


What is the expected output? What do you see instead?

The output is "100.000,00 €". This is partially understandable but also 
confusing. It is understandable insofar as Eurozone countries tend to use the 
period/full-stop as the thousands separator and the comma as the decimal 
separator. However, it is confusing in that the code is running in a culture 
context that reverses these symbols. I would *not* argue for a change in the 
current behaviour, but an ability to provide a NumberFormatInfo to use when 
parsing the decimal portion would be good. See below for an example 
implementation.


What version of the product are you using? On what operating system?
Version 3.5.1.0 on Windows 8.1 Update 1, .NET 4.5.


Please provide any additional information below.
Attached is a modification of Money.Parsing.cs file to add a new overload 
taking NumberFormatInfo. I would very much like for this to be merged into the 
code base. I assign the copyright to the copyright owner of the existing file, 
provide no warranty as to its usage, etc. etc.!


Original issue reported on code.google.com by [email protected] on 7 Aug 2014 at 10:21

Attachments:

Finite denominations when counting ways of making change

CountWaysToMakeChange() works under the premise that the set of denominations that is passed is infinite, that is, we never "run out" of pieces for each denomination.

In the real-world, there is only a finite amount of pieces of each denomination. Change the algorithm (and change Denomination as well) or create another method (taking, for instance a collection of FiniteDenominations) to support this real-world scenario.

GetObjectData in class Money is incorrect

Currently is

public void GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue(Serialization.Data.Money.AMOUNT, Amount);
info.AddValue(Serialization.Data.Money.CURRENCY, CurrencyCode, typeof(Currency));
}

Should be:
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue(Serialization.Data.Money.AMOUNT, Amount);
info.AddValue(Serialization.Data.Money.CURRENCY, CurrencyCode, typeof(CurrencyIsoCode));
}

See https://msdn.microsoft.com/en-us/library/akebc4z9(v=vs.110).aspx

https://github.com/dgg/nmoneys/blob/master/src/NMoneys/Money.Serialization.cs

With this fix, Money serializes fine with VelocityDB, see https://velocitydb.com/

Money.Parse

Implement a functionality to parse a monetary amount.


Original issue reported on code.google.com by [email protected] on 28 Oct 2010 at 7:08

Make Money an struct

It should make use of an internal Currency instance when needed, but is state 
is made up of a decimal amount and a CurrencyIsoCode currency


Original issue reported on code.google.com by [email protected] on 25 Oct 2010 at 12:55

Documentation for DKK symbol

Hey :)

Do you have any documentation regarding the decision for formatting DKK symbol as "kr" and not "kr."?

Assert.That(subject.ToString(), Is.EqualTo("kr 5,00"), "Kroner symbol DOES not include dot. Mistake in Vista and newer.");

I'v been asked to change the formatting, and just want to make sure that we're doing the right thing.

currency concurrent initialization

When trying to make a NMoneys.Currency.Get(<<currencyIso>>) of an uninitialised 
currency from multiple concurrent System.Threading.Tasks.Task you will get:

System.ArgumentException: An item with the same key has already been added.
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at NMoneys.Support.ThreadSafeCache`2.Add(TKey key, TValue value)
   at NMoneys.Currency.Get(CurrencyIsoCode isoCode)

You have in the attach the unit test to reproduce this.

I may suggest to use ConcurrentDictionary<TKey, TValue> to keep the initialized 
currencies.

Thank you for your useful library!

Regards,
Cosmin


Original issue reported on code.google.com by [email protected] on 23 Feb 2015 at 9:27

Attachments:

Add support for Html entities

Add support for getting the html entity information for those currencies that 
support it.

http://www.alanwood.net/unicode/currency_symbols.html
http://www.w3schools.com/tags/ref_entities.asp


Original issue reported on code.google.com by [email protected] on 4 Nov 2010 at 9:41

Signed Assembly

Can you please sign the output assemblies so that we can use them in other 
projects without having to sign them ourselves?


Original issue reported on code.google.com by [email protected] on 19 Aug 2011 at 11:29

Ammendment 156

From 2014/01/01 Latvian lats LAT become deprecated in favor of EUR.


Original issue reported on code.google.com by [email protected] on 6 Jan 2014 at 3:20

DataGrid OrderBy

Hello

I've just recently adapted my app to use your excellent lib.
One of my fields contain an amount expressed with NMoneys (different currencies on different rows).

I just tryed binding directly to a NMoneys.Money field, but the datagrid would not order. Am i missing something ?

Test serialization methods

Xml: public class SerializationHelper<T> where T : class
{
    public string SerializeXml(T o)
    {
        var serializer = new XmlSerializer(typeof(T));

        var sb = new StringBuilder();
        using (var tw = new StringWriter(sb))
        {
            serializer.Serialize(tw, o);
        }

        return sb.ToString();
    }

    public T DeserializeXml(string text)
    {
        var serializer = new XmlSerializer(typeof(T));

        using (var tr = new StringReader(text))
        {
            return (T)serializer.Deserialize(tr);
        }
    }
}

Xaml and datacontract


Original issue reported on code.google.com by [email protected] on 1 Jul 2010 at 11:12

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.