Merge pull request #320 from Mortalife/master

Decimal place fix on import
This commit is contained in:
James Cole 2016-09-20 20:21:02 +02:00 committed by GitHub
commit 1357352276

View File

@ -23,6 +23,7 @@ class Amount extends BasicConverter implements ConverterInterface
* Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.
* - Jamie Zawinski
*
*
* @param $value
*
* @return float
@ -33,7 +34,7 @@ class Amount extends BasicConverter implements ConverterInterface
$decimalPosition = $len - 3;
$decimal = null;
if ($len > 2 && $value{$decimalPosition} == '.') {
if (($len > 2 && $value{$decimalPosition} == '.') || ($len > 2 && strpos($value, '.') > $decimalPosition)) {
$decimal = '.';
}
if ($len > 2 && $value{$decimalPosition} == ',') {