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 {
|
||||
$tempMask = array_pop($masks);
|
||||
$postDecimalMasks[] = $tempMask;
|
||||
$decimalCount -= strlen($tempMask);
|
||||
} while ($decimalCount > 0);
|
||||
if ($tempMask !== null) {
|
||||
$postDecimalMasks[] = $tempMask;
|
||||
$decimalCount -= strlen($tempMask);
|
||||
}
|
||||
} while ($tempMask !== null && $decimalCount > 0);
|
||||
|
||||
return [
|
||||
implode('.', $masks),
|
||||
|
|
|
|||
|
|
@ -362,4 +362,24 @@ return [
|
|||
25,
|
||||
'[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