--- title: GlideCurrencyConverter - Scoped description: The GlideCurrencyConverter API provides methods to convert one currency value to another, such as converting US dollars into European euros.Instantiates a GlideCurrencyConverter object.Instantiates a GlideCurrencyConverter object and sets the source and destination country codes to use in the currency conversion.Executes the currency converter.Sets the amount of currency to convert.Sets the currency conversion date and time.Sets the country code of the source currency.Defines the rate table to use in the currency conversion.Sets the country code of the destination currency. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/api-reference/server-api-reference/GlideCurrencyConverterScopedAPI.html release: australia product: Server API Reference classification: server-api-reference topic_type: concept last_updated: "2026-03-12" reading_time_minutes: 4 breadcrumb: [Server API reference, API reference, API implementation and reference] --- # GlideCurrencyConverter- Scoped The GlideCurrencyConverter API provides methods to convert one currency value to another, such as converting US dollars into European euros. You can instantiate the GlideCurrencyConverter object and define the source and destination currencies during instantiation using GlideCurrencyConverter\(from, to\). You can also instantiate the object without these values and define them later using the setFromCurrency\(\) and setToCurrency\(\) methods. These values and the amount to convert must be set before calling the convert\(\) method to perform the currency conversion. To set the amount to convert, use the setAmount\(\) method. The GlideCurrencyConverter API also provides optional methods that enable you to: - Set the date and time for which to perform the conversion, setDateTime\(\). By setting the date and time, the rate that is used in the conversion calculation is that for the specified date and time, instead of the default of the current date and time. - Set the rate table to use in the conversion, setRateTable\(\). By default the conversion uses the fx\_system\_rate table however, you can define custom rate tables for your instance. For additional information on creating rate tables, see [Add conversion rates using a custom rate table](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-administration/custom-rate-table.md). This API is provided within the `sn_currency` namespace. **Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md) ## GlideCurrencyConverter - GlideCurrencyConverter\(\) Instantiates a GlideCurrencyConverter object. |Name|Type|Description| |----|----|-----------| |None| | | This example shows how to call the method. ```api-constructor var conv = new sn_currency.GlideCurrencyConverter(); ``` ## GlideCurrencyConverter - GlideCurrencyConverter\(String from, String to\) Instantiates a GlideCurrencyConverter object and sets the source and destination country codes to use in the currency conversion. |Name|Type|Description| |----|----|-----------| |from|String|Three-letter ISO 3166 country code of the source currency.| |to|String|Three-letter ISO 3166 country code of the converted currency.| This example shows how to call the method. ```api-constructor var conv = new sn_currency.GlideCurrencyConverter('EUR', 'USD'); ``` ## GlideCurrencyConverter - convert\(\) Executes the currency converter. Call this method after calling other GlideCurrencyConverter methods that construct the currency conversion, such as setAmount\(\), setRateTable\(\), and setDate\(\). |Name|Type|Description| |----|----|-----------| |None| | |
| Type | Description |
|---|---|
| [GlideCurrencyExchangeValue](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/GlideCurrencyExchangeValueScopedAPI.md) object | GlideCurrencyExchangeValue object containing details about the conversion.``` CurrencyExchangeValue{ fAmount: Number, fCurrency: "String", fOriginalAmount: Number, fOriginalCurrency: "String", fRate: Number, fRateSysId: "String" } ``` |
| CurrencyExchangeValue.fAmount | Converted amount \(**fOriginalAmount** \* **fRate**\).Data type: Number |
| CurrencyExchangeValue.fCurrency | ISO 4217 alphabetic currency code for the converted currency.Data type: String |
| CurrencyExchangeValue.fOriginalAmount | Original currency amount.Data type: Number |
| CurrencyExchangeValue.fOriginalCurrency | ISO 4217 alphabetic currency code for the original currency.Data type: String |
| CurrencyExchangeValue.fRate | Exchange rate used in the conversion.Data type: Number |
| CurrencyExchangeValue.fRateSysId | Sys\_id of the exchange rate used in the conversion.Table: Currency Conversion Rate \[fx\_conversion\_rate\] Data type: String |