File tree 1 file changed +4
-1
lines changed
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -322,7 +322,7 @@ private function stringToUnits($string)
322
322
$ sign = "(?P<sign>[-\+])? " ;
323
323
$ digits = "(?P<digits>\d*) " ;
324
324
$ 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) " ;
326
326
$ pattern = "/^ " .$ sign .$ digits .$ separator .$ decimals ."$/ " ;
327
327
328
328
if (!preg_match ($ pattern , trim ($ string ), $ matches )) {
@@ -333,6 +333,9 @@ private function stringToUnits($string)
333
333
$ units .= $ matches ['digits ' ];
334
334
$ units .= isset ($ matches ['decimal1 ' ]) ? $ matches ['decimal1 ' ] : "0 " ;
335
335
$ 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 " ;
336
339
337
340
return (int ) $ units ;
338
341
}
You can’t perform that action at this time.
0 commit comments