$exchange = new FixedExchange([
'USD' => [
'KZT' => "374.3",
]
]);
$converter = new Converter(new ISOCurrencies(), $exchange);
$amount = $converter->convert(new Money(800, new Currency('USD')), new Currency('KZT'), Money::ROUND_UP);
print($amount->getAmount());
299441
instead of 29940.
As you can see, I pass a string "374.3" when creating and exchange instance, but in your code (CurrencyPair __construct) you convert my correct string to incorrect float. Then in convert method of Converter class you try to get a string from that float - and fail to get correct string.
The problem is that currency conversion ratio before multiplying becomes 374.3000000001.
Please, advise, why so and how to fix this?
We use php/money 3.x since our project is PHP 7.2.4
We use php/money 3.x since our project is PHP 7.2.4