Closed dobstera closed 4 years ago
Hi @dobstera, sorry to hear that you're having problems.
The convert()
method accepts integers for monetary value. You'll need to pass it in in your currencies lowest denomination. For example, to convert $0.99 you'd need to pass in 99 and to convert $2.99 you'd need to pass in 299.
There's an example in the docs if this helps: https://github.com/ash-jc-allen/laravel-exchange-rates#convert-currencies
I hope you manage to get it working 😃
When you try to convert a float value (say 42.65), the calculation is not correct, because the input $value is cast to int instead of float in "ExchangeRate" class at line 242:
public function convert(int $value, string $from, $to, Carbon $date = null)