Torann / laravel-currency

This provides Laravel with currency functions such as currency formatting and conversion using up-to-date exchange rates.
http://lyften.com/projects/laravel-currency
BSD 2-Clause "Simplified" License
395 stars 136 forks source link

Division by zero when no exchange rates found #129

Open giovannipds opened 4 years ago

giovannipds commented 4 years ago

When running a basic sample at a new installation welcome.blade.php:

@php
echo currency(12, 'usd', 'ars');
@endphp

Gives an error:

Facade\Ignition\Exceptions\ViewException
Division by zero

at vendor\torann\currency\src\Currency.php:94 $value = ($amount * $to_rate) / $from_rate;

PR #111 probably fixes that.

That happens when no exchange_rate is provided at the from currency value.