Updated live currency exchange

Updated to enable any valid currency pair to be used.

This snippet gives live exchange rates. In order to use it, you need to get a personal API token from https://exchangerate.host/ which will replace the XXXX in the snippet. The free option gives you 100 queries per month.

Enter any valid Currency Pair {formtext: name=currency_pair; default=GBPUSD; cols=10; trim=right}
{base_currency=left(upper(currency_pair),3)}
{quote_currency=right(upper(currency_pair),3)}
{note: trim=no; preview=no}{urlload: https://api.exchangerate.host/live?source={=base_currency}&currencies={=quote_currency}&access_key=XXXX; done=(res) -> ["response": fromjson(res), "isloading": no]; start=() -> ["isloading": yes]} {if: isloading}Loading...{else}Response: {=response}{endif}{rate=response["quotes"][upper(currency_pair)]; trim=yes}{endnote}
{=base_currency}/{=quote_currency} Exchange Rate = {=rate} at {time: HH:mm} on {time: Do MMM YY}

Base amount {formtext: name=amount; cols=7} Currency equivalent = {=amount* rate; format=.2f}