You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.
Current behavior throws a CurrencyException when the currency code is not found in the predefined templates.
Found this to be problematic when using together with danielme85/laravel-cconverter
I did not want to have to compile and format all the possible currencies I could encounter, so I altered the constructor to use a general template in case no predefined one is found.
public function __construct($code)
{
if (! $this->hasCurrency($code)) {
//throw new CurrencyException("Currency not found: \"{$code}\""); - No longer needed
$currency = [
'code' => $code,
'title' => '',
'symbol' => null,
'precision' => 2,
'thousandSeparator' => ' ',
'decimalSeparator' => ',',
'symbolPlacement' => 'after'
];
}else $currency = $this->getCurrency($code);
foreach ($currency as $key => $value) {
if (property_exists($this, $key)) {
$this->$key = $value;
}
}
}
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Current behavior throws a CurrencyException when the currency code is not found in the predefined templates.
Found this to be problematic when using together with danielme85/laravel-cconverter
I did not want to have to compile and format all the possible currencies I could encounter, so I altered the constructor to use a general template in case no predefined one is found.
The text was updated successfully, but these errors were encountered: