Skip to content

Instantly share code, notes, and snippets.

@matheus-rossi
Created September 25, 2017 19:32
Show Gist options
  • Save matheus-rossi/e734194616f241c08f317e4012a18a88 to your computer and use it in GitHub Desktop.
Save matheus-rossi/e734194616f241c08f317e4012a18a88 to your computer and use it in GitHub Desktop.
const convertCurrencyAlt = async (from, to, amount) => {
const countries = await getCountriesAlt(to)
const rate = await getExchangeRateAlt(from, to)
const exchangedAmount = amount * rate
return `${amount} ${from} is worth ${exchangedAmount} ${to}. ${to} can be used in the following countries: ${countries.join(', ')}`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment