activa Posted October 8, 2015 Report Posted October 8, 2015 i have a code that i can convert a currency to another currency , now i want to get the exchange rate $amount = $this->Currencies->convert($amount, $from_currency, $to_currency, $company_id) ; now i want to get the exchange rate for this conversion ? is possible from the model it self ?
Cody Posted October 8, 2015 Report Posted October 8, 2015 You want Currencies::get() Note that the exchange_rate is based off of your default currency. So if you want the rate of conversion between two currencies and neither is the default currency, you'll need to pull all 3 currencies and calculate the difference.
Blesta Addons Posted October 9, 2015 Report Posted October 9, 2015 You can do it like that $amount = $this->Currencies->convert($original_amount, $from_currency, $to_currency, $company_id) ; $exchange_rate = ($amount/$original_amount) ; activa 1
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now