Git Product home page Git Product logo

money's People

Contributors

acasademont avatar psincraian avatar sdepablos 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

money's Issues

Final prevents Doctrine Embeddable with annotations to work

I'm trying to use your library with Doctrine 2.5 embeddable objects. Unfortunately, this is impossible because I'm using annotations instead of YAML and the docblock must be applied to the properties. I can't extend the class to do it because you marked it as final. I know there has already been a long discussion about why you decided to restrict users from inheriting the Money class, but this makes this whole library unusable for anyone using annotations (that are really common on Symfony).

Money does not round negative numbers correctly

An example is the following

$money = Money::fromAmount('-3.9813', Currency::fromCode('EUR'));
$money->round(2)->amount() => -3.97

In this case the expected value is -3.98, we don't need to round.

In the following example we need to round but the expected and the expected value is -3.99.

$money = Money::fromAmount('-3.9863', Currency::fromCode('EUR'));
$money->round(2)->amount() => -3.98

Why final?

Does it make sense to mark it as such, knowing that it's a public library and users are expected to tinker with it? It's currently preventing us from adding everyday helpers like format() or toFloat(), and we don't really see the benefit.

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.