mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Expand API with v2 summary endpoint.
This commit is contained in:
@@ -34,6 +34,21 @@ class ExchangeRateConverter
|
||||
{
|
||||
use ConvertsExchangeRates;
|
||||
|
||||
/**
|
||||
* @param TransactionCurrency $from
|
||||
* @param TransactionCurrency $to
|
||||
* @param Carbon $date
|
||||
* @param string $amount
|
||||
*
|
||||
* @return string
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function convert(TransactionCurrency $from, TransactionCurrency $to, Carbon $date, string $amount): string
|
||||
{
|
||||
$rate = $this->getCurrencyRate($from, $to, $date);
|
||||
return bcmul($amount, $rate);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param TransactionCurrency $from
|
||||
* @param TransactionCurrency $to
|
||||
|
Reference in New Issue
Block a user