Download the PHP package fortis/moneyobject without Composer
On this page you can find all versions of the php package fortis/moneyobject. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fortis/moneyobject
More information about fortis/moneyobject
Files in fortis/moneyobject
Package moneyobject
Short Description A PHP library providing immutable Money value object
License MIT
Homepage https://github.com/fortis/moneyobject
Informations about the package moneyobject
moneyobject
A PHP library providing immutable Money value object with arbitrary-precision and solution for floating point rounding errors.
What do you think will be printed in the example below?
Actually not equals 😈
. You can try https://ideone.com/2UQlBF.
Squeezing infinitely many real numbers into a finite number of bits requires an approximate representation. Although there are infinitely many integers, in most programs the result of integer computations can be stored in 32 bits. In contrast, given any fixed number of bits, most calculations with real numbers will produce quantities that cannot be exactly represented using that many bits. Therefore the result of a floating-point calculation must often be rounded in order to fit back into its finite representation. This rounding error is the characteristic feature of floating-point computation.
-- Oracle
Install
Install directly from command line using Composer
QuickStart
Currency code validation
Create Money instance
Get currency
Get amount
Multiply: 100.20 * 2
Divide: 100.20 / 2
Plus: 100.20 + 2.5
Minus: 100.20 - 0.5
Minus: 36 - 35.99
Minus: 36 - 35.99
Convert USD to EUR
Credits
License
moneyobject is licensed under the MIT license.