convertAmountToDesiredCurrency method

Future<String> convertAmountToDesiredCurrency(
  1. String amount, {
  2. String sourceCurrency = "EUR",
  3. String destinationCurrency = 'USDT',
  4. int numberOfDecimals = 3,
})

Implementation

Future<String> convertAmountToDesiredCurrency(String amount,
    {String sourceCurrency = "EUR",
    String destinationCurrency = 'USDT',
    int numberOfDecimals = 3}) async {
  final am = await Forex().getCurrencyConverted(
      sourceCurrency: sourceCurrency,
      destinationCurrency: destinationCurrency,
      sourceAmount: double.parse(amount),
      numberOfDecimals: numberOfDecimals);
  return am.toString();
}