parent
e2f87e8b7a
commit
f9f9f4cacf
|
@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org).
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- Fix ROUNDUP and ROUNDDOWN for floating-point rounding error [#1404](https://github.com/PHPOffice/PhpSpreadsheet/pull/1404)
|
- Fix ROUNDUP and ROUNDDOWN for floating-point rounding error [#1404](https://github.com/PHPOffice/PhpSpreadsheet/pull/1404)
|
||||||
|
- Fix ROUNDUP and ROUNDDOWN for negative number [#1417](https://github.com/PHPOffice/PhpSpreadsheet/pull/1417)
|
||||||
- Fix loading styles from vmlDrawings when containing whitespace [#1347](https://github.com/PHPOffice/PhpSpreadsheet/issues/1347)
|
- Fix loading styles from vmlDrawings when containing whitespace [#1347](https://github.com/PHPOffice/PhpSpreadsheet/issues/1347)
|
||||||
- Fix incorrect behavior when removing last row [#1365](https://github.com/PHPOffice/PhpSpreadsheet/pull/1365)
|
- Fix incorrect behavior when removing last row [#1365](https://github.com/PHPOffice/PhpSpreadsheet/pull/1365)
|
||||||
- MATCH with a static array should return the position of the found value based on the values submitted [#1332](https://github.com/PHPOffice/PhpSpreadsheet/pull/1332)
|
- MATCH with a static array should return the position of the found value based on the values submitted [#1332](https://github.com/PHPOffice/PhpSpreadsheet/pull/1332)
|
||||||
|
|
|
@ -1139,9 +1139,7 @@ class MathTrig
|
||||||
|
|
||||||
if ((is_numeric($number)) && (is_numeric($digits))) {
|
if ((is_numeric($number)) && (is_numeric($digits))) {
|
||||||
if ($number < 0.0) {
|
if ($number < 0.0) {
|
||||||
$significance = pow(10, (int) $digits);
|
return round($number - 0.5 * pow(0.1, $digits), $digits, PHP_ROUND_HALF_DOWN);
|
||||||
|
|
||||||
return floor($number * $significance) / $significance;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return round($number + 0.5 * pow(0.1, $digits), $digits, PHP_ROUND_HALF_DOWN);
|
return round($number + 0.5 * pow(0.1, $digits), $digits, PHP_ROUND_HALF_DOWN);
|
||||||
|
@ -1167,9 +1165,7 @@ class MathTrig
|
||||||
|
|
||||||
if ((is_numeric($number)) && (is_numeric($digits))) {
|
if ((is_numeric($number)) && (is_numeric($digits))) {
|
||||||
if ($number < 0.0) {
|
if ($number < 0.0) {
|
||||||
$significance = pow(10, (int) $digits);
|
return round($number + 0.5 * pow(0.1, $digits), $digits, PHP_ROUND_HALF_UP);
|
||||||
|
|
||||||
return ceil($number * $significance) / $significance;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return round($number - 0.5 * pow(0.1, $digits), $digits, PHP_ROUND_HALF_UP);
|
return round($number - 0.5 * pow(0.1, $digits), $digits, PHP_ROUND_HALF_UP);
|
||||||
|
|
|
@ -71,6 +71,16 @@ return [
|
||||||
2.26 + 2.94,
|
2.26 + 2.94,
|
||||||
2,
|
2,
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
-4.44,
|
||||||
|
-4.4400,
|
||||||
|
2,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
-5.20,
|
||||||
|
-2.26 - 2.94,
|
||||||
|
2,
|
||||||
|
],
|
||||||
[
|
[
|
||||||
'#VALUE!',
|
'#VALUE!',
|
||||||
'ABC',
|
'ABC',
|
||||||
|
|
|
@ -66,11 +66,21 @@ return [
|
||||||
4.4400,
|
4.4400,
|
||||||
2,
|
2,
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
-4.44,
|
||||||
|
-4.4400,
|
||||||
|
2,
|
||||||
|
],
|
||||||
[
|
[
|
||||||
5.20,
|
5.20,
|
||||||
2.26 + 2.94,
|
2.26 + 2.94,
|
||||||
2,
|
2,
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
-5.20,
|
||||||
|
-2.26 - 2.94,
|
||||||
|
2,
|
||||||
|
],
|
||||||
[
|
[
|
||||||
'#VALUE!',
|
'#VALUE!',
|
||||||
'ABC',
|
'ABC',
|
||||||
|
|
Loading…
Reference in New Issue