Created
October 6, 2022 22:08
-
-
Save andreypopp/09f9dcb11decff3427883625d04a6454 to your computer and use it in GitHub Desktop.
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
function NBG_CURRENCY(currency, date) { | |
let [m, d, y] = [date.getMonth(), date.getDate(), date.getFullYear()]; | |
let dates = `${y}-${m+1}-${d}` | |
let url = `https://nbg.gov.ge/gw/api/ct/monetarypolicy/currencies/en/json/?currencies=${currency}&date=${dates}`; | |
let resp = UrlFetchApp.fetch(url); | |
return JSON.parse(resp.getContentText())[0].currencies[0].rate; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment