Interface CurrencyConversionService
public interface CurrencyConversionService
-
Method Summary
Modifier and TypeMethodDescriptionconvertCurrency(Money source, Currency destinationCurrency, int destinationScale) Converts the given Money into the destination.
-
Method Details
-
convertCurrency
Converts the given Money into the destination. The starting currency is determined bysource.getCurrency()- Parameters:
source- - the Money to convertdestinationCurrency- - which Currency to convert todestinationScale- - the scale that the result will be in. If zero, this defaults to the scale of source and if that is zero, defaults toBankersRounding.DEFAULT_SCALE- Returns:
- a new Money in destinationCurrency. If the source and destination are the same currency, the original source is returned unchanged
-