The .standard customization uses hard-coded rates. To support live currency conversions, implement or use a CurrencyRateProvider and assign it to the currencyRateProvider property of an EngineCustomization.
SoulverCore provides ECBCurrencyRateProvider out-of-the-box, which fetches rates from the European Central Bank.
/// This is a currency rate provider that fetches 33 popular fiat currencies from the European Central Bank
let ecbCurrencyRateProvider = ECBCurrencyRateProvider()
/// Create a customization with this rate provider
var customizationWithLiveCurrencyRates = EngineCustomization.standard
customizationWithLiveCurrencyRates.currencyRateProvider = ecbCurrencyRateProvider
/// Create a calculator that uses this customization
let calculator = Calculator(customization: customizationWithLiveCurrencyRates)
/// Update to the latest rates...
ecbCurrencyRateProvider.updateRates { success in
if success {
let result = calculator.calculate("10 USD in EUR")
print(result.stringValue)
}
}