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