DOLLAR

DOLLAR returns the value of a given number in dollars.

Functional category: Text

Syntax

DOLLAR(arg1, [arg2])

Arguments

Description

arg1

Number to be converted to dollar value

arg2

Optional. Number representing the number of decimal places to round to (defaults to 2)

Examples

Let's say we receive the following purchasing information.

{
"data": {
"purchases": {
"region": {
"east": 2019900,
"west": 1563005,
"south": 200000
}
}
}
}

Example 1: Return a value in dollars

If we want to transform values into dollar notation, use the following function.

# transform a value to dollar notation
DOLLAR(data.purchases.region.east)
# Returns $2019900.00

Example 2: Rounding argument

We can also include a rounding argument using the following function.

# Transform a value to dollar notation and round the result
DOLLAR(data.purchases.region.west, 1)
# Returns $1563005.00