akaunting / laravel-money

Currency formatting and conversion package for Laravel
https://akaunting.com
MIT License
732 stars 101 forks source link

convert function why always mutliplying? #60

Closed jcordingley closed 2 years ago

jcordingley commented 2 years ago

Hi All,

I am looking into using the package but have questions regarding the convert function, looking through the source code it always seems to multiply and I am wondering why?

e.g. If i have an amount in USD but my local currency is GBP.

$amount = 500; $exRate = 1.3195; $localAmount = (new Money($amount, new Currency('USD'), true))->mutable(); $localAmount ->convert(new Currency('GBP'), $exRate);

Can anyone explain why it is doing this? I am not saying it's wrong as such i am just trying to gauge an understanding!