Download the PHP package tiny-blocks/money without Composer
On this page you can find all versions of the php package tiny-blocks/money. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tiny-blocks/money
More information about tiny-blocks/money
Files in tiny-blocks/money
Package money
Short Description Value Object that represents a monetary value.
License MIT
Homepage https://github.com/tiny-blocks/money
Informations about the package money
Money
- Overview
- Installation
- How to use
- License
- Contributing
Overview
Value Object that represents a monetary value.
Installation
How to use
The library exposes a concrete implementation for representing and performing monetary operations.
Using from methods
You can create a new instance of Money
using one of the following methods based on the type of the value.
From BigNumber
With the from
method, a new instance of type Money
is created from a BigNumber
value.
From float
With the fromFloat
method, a new instance of type Money
is created from a float
value. Note that floating point
values
are imprecise and may result in a loss of precision.
From string
With the fromString
method, a new instance of type Money
is created from a string
value.
Using the methods of mathematical operations
Addition
Performs an addition operation between this value and another value.
Subtraction
Performs a subtraction operation between this value and another value.
Multiplication
Performs a multiplication operation between this value and another value.
Division
Performs a division operation between this value and another value.
License
Money is licensed under MIT.
Contributing
Please follow the contributing guidelines to contribute to the project.
All versions of money with dependencies
tiny-blocks/math Version ^3
tiny-blocks/currency Version ^2
ext-bcmath Version *