prestashop/decimal
Object-oriented wrapper/shim for BC Math PHP extension. Allows for arbitrary-precision math operations.
1.5.0
9.2M downloads/mo
#1856 most downloaded on Packagist
PrestaShop/decimal
What this package is like to depend on
Last release 5 years ago
no release in 18 months
Release timing varies
gaps range from 2 weeks to 1.9 years
Most releases are documented
notes for 5 of 6 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
6 releases · first in 2017
0 releases in the last 12 months
see the full history below
Release timeline
6 releases · Aug 2017 to Feb 2022Releases
latest 6-
1.5.002 Feb 2022Release notes
Open source →This release fixes bug #19 and also contains multiple commits improving the CI.
-
1.4.008 Oct 2020Release notes
Open source →This release rename calls.
Previously, you call
new PrestaShop\Decimal\Number.
Now, you callnew new PrestaShop\Decimal\DecimalNumber.But the call for
new PrestaShop\Decimal\Numberis always available for retrocompatibility, but deprecated. -
1.3.015 Apr 2020Release notes
Open source →This release adds a couple shorthand methods to perform comparisons with zero:
$a = new PrestaShop\Decimal\Number('777.777'); $a->equalsZero(); // returns false $a->isLowerThanZero(); // returns false $a->isLowerOrEqualThanZero(); // returns false $a->isGreaterThanZero(); // returns true $a->isGreaterOrEqualThanZero(); // returns true
-
1.2.017 Jul 2019Release notes
Open source →This version adds support for creating Numbers using the scientific notation (as described in the PHP documentation), as well as floats without leading zero (e.g.
.001). -
1.1.022 Aug 2017Release notes
Open source →This minor version fixes an ambiguity in the way trailing zeroes are handled by Decimal.
BCMath always returns trailing zeroes whereas Decimal 1.0 always strips them, unless the requested precision is greater than the number's (in that case it adds trailing zeroes).
We fixed that ambiguity by exposing two methods instead of one:
toPrecision()- which always returns trailing zeroesround()- which always strips trailing zeroes
-
1.0.010 Aug 2017Nothing published for this version