Last active
October 20, 2025 22:07
-
-
Save pH-7/823feb6c9d4f2def8b93e9143adb373d to your computer and use it in GitHub Desktop.
TextExpander compatible snippet that instantly gives the current live exchange rate displayed on your screen. AUD to EUR currency conversion. You can easily change to any other currency by changing "AUD" and "EUR" or using TextExpander fill-in fields. https://PierreHenry.dev
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| try { | |
| var xhr = new XMLHttpRequest(); | |
| xhr.open('GET', 'https://api.exchangerate-api.com/v4/latest/AUD', false); | |
| xhr.send(); | |
| var data = JSON.parse(xhr.responseText); | |
| var eurRate = data.rates.EUR; | |
| var amount = 1; | |
| var converted = (amount * eurRate).toFixed(2); | |
| amount + " AUD = " + converted + " EUR (Rate " + eurRate.toFixed(4) + ")"; | |
| } catch (error) { | |
| "Exchange rate unavailable. Check Internet connection"; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment