ulabox / money Goto Github PK
View Code? Open in Web Editor NEWYet another PHP implementation of the Money value object using BCMath
License: MIT License
Yet another PHP implementation of the Money value object using BCMath
License: MIT License
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
As the title says, just readme seems is not updated to last version as Money::EUR
method no longer exists.
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.
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).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.