Skip to content

Commit ee59f09

Browse files
committed
Merge genkgo#7 and fix tests
1 parent 137eac0 commit ee59f09

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Camt053/Decoder.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ private function stringToUnits($string)
322322
$sign = "(?P<sign>[-\+])?";
323323
$digits = "(?P<digits>\d*)";
324324
$separator = "(?P<separator>[.,])?";
325-
$decimals = "(?P<decimal1>\d)?(?P<decimal2>\d)";
325+
$decimals = "(?P<decimal1>\d)?(?P<decimal2>\d)?(?P<decimal3>\d)?(?P<decimal4>\d)?(?P<decimal5>\d)";
326326
$pattern = "/^".$sign.$digits.$separator.$decimals."$/";
327327

328328
if (!preg_match($pattern, trim($string), $matches)) {
@@ -333,6 +333,9 @@ private function stringToUnits($string)
333333
$units .= $matches['digits'];
334334
$units .= isset($matches['decimal1']) ? $matches['decimal1'] : "0";
335335
$units .= isset($matches['decimal2']) ? $matches['decimal2'] : "0";
336+
$units .= isset($matches['decimal3']) ? $matches['decimal3'] : "0";
337+
$units .= isset($matches['decimal4']) ? $matches['decimal4'] : "0";
338+
$units .= isset($matches['decimal5']) ? $matches['decimal5'] : "0";
336339

337340
return (int) $units;
338341
}

0 commit comments

Comments
 (0)