You can use currency fields in scripts.

These methods are available on GlideElement objects.

To display currency values, use the getDisplayValue() display API. To work with currency values in any way other than display, use the APIs that return/accept unformatted numbers.

Note: Before performing calculations on the value, do not use the getDisplayValue() methods and then process the string to remove formatting information.
Methods such as getValue() and getCurrencyValue() return unformatted numbers as strings. To obtain the floating point value, use the JavaScript function parseFloat(), and then use resulting value to perform calculations. To obtain the currency associated with these values, use the APIs that return the currency code. You can also use the getCurrencyCode() methods to determine a field's currency.
var rate = parseFloat(current.base_rate);
var currencyCode = current.base_rate.getCurrencyCode();
Use the setValue() method to set the value of a currency field. If this currency is the user’s session currency, use a plain number or the floating point number of a string containing it. Otherwise, prefix the value with the 3-letter ISO currency code.
var totalCost = rate*current.hourly_rate;
current.total_cost.setValue(currencyCode + ";" + totalCost);

You are working with the reference currency value when you use GlideAggregate on currency or price fields. Be sure to convert the aggregate values to the user's session currency for display. The resulting value may not be what you expect. The conversion rate used for the currency or price field value, and for its reference currency, which is used for the aggregation, may have changed.

When you delete a record containing a currency value, the platform deletes any associated currency records.
Note: Do not use deleteMultiple() on tables with currency fields. Always delete each record individually.
Currency values contain four decimal places.
  • APIs that return values such as getValue() return up to four decimal places. Trailing zeros are always removed.
  • APIs that return display values such as getDisplayValue() have at least two decimal places and up to four decimal places.
  • GlideAggregate returns four decimal places.
You can have the system use two decimal places. When you set it to two decimal places, numeric values returned by the API contain two decimal places. Although currency conversion rates may have more decimal places, currency fields store only two decimal places. APIs that accept numeric values round decimal places to two places.
  • APIs that return values such as getValue() return up to two decimal places. The trailing zeroes are removed for values read from the database, but if a value such as 00 is set later, 1.00 can be returned. The number of trailing zeros returned is not consistent.
  • APIs that return display values such as getDisplayValue() contain up to two decimal places. It could sometimes return two places even for values such as 7.10, but could remove trailing zeros at other times. The number of trailing zeros returned is not consistent.
  • GlideAggregate returns two decimal places.
Note: To learn how to change the number of decimal places used by the system, see Change default currency decimal places.
The following example, the user’s locale is set to German (de.DE), and the reference currency set to USD. The values use a currency value of 21345.67 in Japanese yen, 1563.72 in Euros, and 1152.48 in US dollars.