Skip to content

Commit

Permalink
Fix number parsing error
Browse files Browse the repository at this point in the history
  • Loading branch information
DASPRiD committed Oct 15, 2020
1 parent 331dfcb commit 34fa93e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Client/ResultSet/Transformer/NumberTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ function (array $match) : string {
$cleanedValue = '0' . $cleanedValue;
}

return Decimal::fromString($cleanedValue);
return Decimal::fromString(rtrim($cleanedValue, '.'));
}
}
1 change: 1 addition & 0 deletions test/Client/ResultSet/Type/NumberTransformerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public function numberProvider() : array
['714/715', '714715'],
['7-14/...71.5', '714.715'],
['foo-7-14/...71.5', '-714.715'],
['1.', '1'],
];
}

Expand Down

0 comments on commit 34fa93e

Please sign in to comment.