greenimp/php-math

A basic set of math scripts that deal in strings to handle long floating point values.

v1.0.1 2022-12-07 23:26 UTC

This package is auto-updated.

Last update: 2025-04-08 05:06:13 UTC


README

A basic set of math scripts that deal in strings to handle long floating point values.

Internally, this uses PHP's BC Math functions, and moneyphp's BcMathCalculator.

The main difference from MoneyPhp is that MoneyPhp's round() method always rounds to an integer, whereas this library can round to a chosen precision as well.

It also adds a few extra functions, such as sum() which will sum an iterable of numbers.

Setup

composer require GreenImp/PhpMath