Skip to content

Releases: PrestaShop/decimal

1.5.0

04 Feb 12:44
b5afdcc
Compare
Choose a tag to compare

This release fixes bug #19 and also contains multiple commits improving the CI.

1.4.0

08 Oct 07:16
1880285
Compare
Choose a tag to compare

This release rename calls.

Previously, you call new PrestaShop\Decimal\Number.
Now, you call new new PrestaShop\Decimal\DecimalNumber.

But the call for new PrestaShop\Decimal\Number is always available for retrocompatibility, but deprecated.

1.3.0

15 Apr 07:41
8b7f476
Compare
Choose a tag to compare

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.0

17 Jul 13:17
11e0f87
Compare
Choose a tag to compare

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.0

22 Aug 14:27
Compare
Choose a tag to compare

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 zeroes
  • round() - which always strips trailing zeroes

1.0.0

10 Aug 14:05
Compare
Choose a tag to compare

First stable release