Convert via NBG rate
nbg_convertConvert an amount between currencies at the official NBG rate for a calendar date, including GEL pairs and weekend/holiday carry-over rates.
Instructions
Converts an amount between two currencies using the official NBG rate in force on a calendar date. Either side may be GEL; a pair without GEL is converted through GEL (via: "GEL"). Show resultRounded as the amount; result is the unrounded value for further calculation. Dates are calendar days in Tbilisi; the default is today. NBG sets a rate on business days around 17:00 Tbilisi time, valid from the next calendar day until the next rate, so after 17:00 tomorrow can be requested by date. Sundays, Mondays and days after a public holiday have no rate of their own: the rate in force was set earlier and is returned with carriedOver true and effectiveDate set to the day it took effect. Quote effectiveDate when carriedOver is true. A date whose rate NBG has not published yet returns an error, never a guess.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | ISO 4217 code, or GEL. | |
| date | No | Calendar date YYYY-MM-DD whose official rate to apply. Defaults to today in Tbilisi. | |
| from | Yes | ISO 4217 code, or GEL. | |
| amount | Yes | Amount in the "from" currency. May be negative. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | ||
| via | Yes | ||
| from | Yes | ||
| rate | Yes | One unit of "from" expressed in "to" | |
| amount | Yes | ||
| result | Yes | Unrounded | |
| carriedOver | Yes | true when the rate in force on requestedDate took effect on an earlier day; it is still the official rate | |
| effectiveDate | Yes | Calendar date the returned rate took effect, as published by NBG | |
| requestedDate | Yes | ||
| resultRounded | Yes | result rounded half up to 2 decimals from the exact value; the amount to show. JSON drops trailing zeros, so 3.90 arrives as 3.9. Exact up to about 7e13 in the target currency; above that the nearest double. |