jaycodesign / decimal
Simple wrapper around BC Math for simple math functions
Installs: 2 206
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 5
Forks: 1
Open Issues: 0
Requires
- ext-bcmath: *
Requires (Dev)
- phpunit/phpunit: 4.0.*
This package is not auto-updated.
Last update: 2025-04-23 17:18:52 UTC
README
Simple wrapper around BC Math for simple math functions
Installation
Simply add a dependency to your project's composer.json
file if you use Composer to manage the dependencies of your project.
Here is a minimal example of a composer.json
file that just defines a dependency on Decimal:
{
"require": {
"jaycodesign/decimal": "dev-master"
}
}
Usage Examples
use JaycoDesign\Decimal\Decimal; Decimal::mul(10, 5); // 50 Decimal::div(10, 5); // 2 Decimal::add(10, 5); // 15 Decimal::sub(10, 5); // 5 Decimal::greater_than(1,2); // TRUE Decimal::less_than(1,2); // FALSE Decimal::trim(10.3400000); // 10.34