Obtaining currency values

The following methods allow you to obtain currency values.

The Example value returned column shows details for an item:
  • Created with an item price of $600 in a system base currency of USD (US dollars)
  • Ordered by a British user in the GBP (British pounds) currency
  • Viewed and fulfilled by a Spanish user in the EUR (Euro) currency
Table 1. Obtaining Currency Values
Method Name Description Example value returned
current.price.getReferenceCurrencyCode() The currency ISO code, in the base system currency. USD
current.price.getReferenceDisplayValue() The price, including the currency symbol, in the base system currency. $600.00
current.price.getReferenceValue() A string representation of the field's value, in the system's basis currency. 600
current.price.getSessionCurrencyCode() The currency ISO code, in the current user's currency. EUR
current.price.getSessionDisplayValue() (or current.price.getDisplayValue() or current.price) A string representation of the field's value, including the currency symbol, in the current user's currency. €449,75
current.price.getSessionValue() A string representation of the field's value, in the current user's currency. 449,75
current.price.getCurrencyCode() The currency ISO code, in the currency used when the item was ordered. GBP
current.price.getCurrencyDisplayValue() A string representation of the field's value, including the currency symbol, in the currency used when the item was ordered. £373.83
current.price.getCurrencyString() A string including the ISO code as well as the price, in the currency used when the item was ordered. GBP;373.83
current.price.getCurrencyValue() The price, in the currency used when the item was ordered. 373.83
Note: Currency symbols are displayed on the left or the right of the currency as appropriate.

Examples

current.price=1000
This sets the current price = 1,000 of whatever the current session currency is. For example, for a Japanese user, the price is JPY (Japanese Yen) 1,000.
current.price='USD;1000'

Sets the current price = 1,000 USD.