convertAmount

fun convertAmount(amount: AmountDto, targetCurrency: IsoCurrencyEnumDto): AmountDto

Converts the given amount to the target currency.

Return

a new instance of AmountDto representing the converted amount in the target currency.

Parameters

amount

the amount to be converted, which includes the current value and its currency.

targetCurrency

the ISO currency to which the amount should be converted.

Throws

if the currency of the provided amount is null.