Fix case where mergeComplexNumberFormatMasks would get stuck in endless-loop (#1793)
* Fix case where mergeComplexNumberFormatMasks would get stuck in endless-loop if $numbers had many decimals
This commit is contained in:
parent
b068639513
commit
f60f37c362
|
|
@ -563,9 +563,11 @@ class NumberFormat extends Supervisor
|
||||||
|
|
||||||
do {
|
do {
|
||||||
$tempMask = array_pop($masks);
|
$tempMask = array_pop($masks);
|
||||||
$postDecimalMasks[] = $tempMask;
|
if ($tempMask !== null) {
|
||||||
$decimalCount -= strlen($tempMask);
|
$postDecimalMasks[] = $tempMask;
|
||||||
} while ($decimalCount > 0);
|
$decimalCount -= strlen($tempMask);
|
||||||
|
}
|
||||||
|
} while ($tempMask !== null && $decimalCount > 0);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
implode('.', $masks),
|
implode('.', $masks),
|
||||||
|
|
|
||||||
|
|
@ -362,4 +362,24 @@ return [
|
||||||
25,
|
25,
|
||||||
'[Green][<>25]"<>25 green";[Red]"else red"',
|
'[Green][<>25]"<>25 green";[Red]"else red"',
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
'pfx. 25.00',
|
||||||
|
25,
|
||||||
|
'"pfx." 0.00;"pfx." -0.00;"pfx." 0.00;',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'pfx. 25.20',
|
||||||
|
25.2,
|
||||||
|
'"pfx." 0.00;"pfx." -0.00;"pfx." 0.00;',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'pfx. -25.20',
|
||||||
|
-25.2,
|
||||||
|
'"pfx." 0.00;"pfx." -0.00;"pfx." 0.00;',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'pfx. 25.26',
|
||||||
|
25.255555555555555,
|
||||||
|
'"pfx." 0.00;"pfx." -0.00;"pfx." 0.00;',
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue