Fixed error, when retrieving prices in USD from LCSC

This fixes issue #552. It seems that LCSC changed their currency symbol for US-Dollar
This commit is contained in:
Jan Böhmer 2024-03-09 22:54:12 +01:00
parent 03854aa207
commit a5b101a0ea

View file

@ -218,7 +218,7 @@ class LCSCProvider implements InfoProviderInterface
{ {
//Decide based on the currency symbol //Decide based on the currency symbol
return match ($currency) { return match ($currency) {
'US$' => 'USD', 'US$', '$' => 'USD',
'€' => 'EUR', '€' => 'EUR',
'A$' => 'AUD', 'A$' => 'AUD',
'C$' => 'CAD', 'C$' => 'CAD',
@ -231,7 +231,8 @@ class LCSCProvider implements InfoProviderInterface
'kr' => 'SEK', 'kr' => 'SEK',
'kr.' => 'DKK', 'kr.' => 'DKK',
'₹' => 'INR', '₹' => 'INR',
default => throw new \RuntimeException('Unknown currency: ' . $currency) //Fallback to the configured currency
default => $this->currency,
}; };
} }