Skip to content

Commit

Permalink
Merge pull request #17 from richard-muvirimi/development
Browse files Browse the repository at this point in the history
Separate rates cojoined with alpha characters
  • Loading branch information
richard-muvirimi committed Sep 29, 2023
2 parents 01358b1 + bc14db6 commit 25dcd27
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/Traits/ScrapesRates.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ private function cleanRate(string $value, string $locale): float
$amount = preg_replace('/(\d)\s+(\d)/', '$1$2', $amount);

if (!is_numeric($amount)) {
// separate alpha characters from numeric
$amount = preg_replace('/([^0-9,.]*)([0-9,.]+)([^0-9,.]*)/i', '$1 $2 $3', $amount);

$words = explode(' ', $amount);

//remove non-numeric words
Expand Down

0 comments on commit 25dcd27

Please sign in to comment.