{"action":"closed","issue":{"url":"https://api.github.com/repos/florianv/laravel-swap/issues/8","repository_url":"https://api.github.com/repos/florianv/laravel-swap","labels_url":"https://api.github.com/repos/florianv/laravel-swap/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/florianv/laravel-swap/issues/8/comments","events_url":"https://api.github.com/repos/florianv/laravel-swap/issues/8/events","html_url":"https://github.com/florianv/laravel-swap/issues/8","id":138308875,"number":8,"title":"Cannot use rate in any computation","user":{"login":"oseintow","id":3071999,"avatar_url":"https://avatars.githubusercontent.com/u/3071999?v=3","gravatar_id":"","url":"https://api.github.com/users/oseintow","html_url":"https://github.com/oseintow","followers_url":"https://api.github.com/users/oseintow/followers","following_url":"https://api.github.com/users/oseintow/following{/other_user}","gists_url":"https://api.github.com/users/oseintow/gists{/gist_id}","starred_url":"https://api.github.com/users/oseintow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oseintow/subscriptions","organizations_url":"https://api.github.com/users/oseintow/orgs","repos_url":"https://api.github.com/users/oseintow/repos","events_url":"https://api.github.com/users/oseintow/events{/privacy}","received_events_url":"https://api.github.com/users/oseintow/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-03T21:57:34Z","updated_at":"2016-03-03T22:14:02Z","closed_at":"2016-03-03T22:14:02Z","body":"The package handles the exchange for me nicely and when i output the result to screen or log it i get the desired result but if i try to use it in any computation i get the following error.\r\n\r\n    exception 'ErrorException' with message 'Object of class Swap\\Model\\Rate could not be converted to int'\r\n\r\nI have tried to typecast the result in any form but still not working. I have tried the follwing but no result\r\n\r\n    $this->rates = \\Swap::quote(\"{$this->store->currency}/USD\");\r\n\r\n    $product->sales_price = $product->sales_price * floatval($this->rates);\r\n    $product->sales_price = $product->sales_price * floatval($this->rates->getValue());\r\n    $product->sales_price = $product->sales_price * (float)$this->rates;\r\n    $product->sales_price = $product->sales_price * (double)$this->rates;\r\n\r\nand many others but still getting the error."}}