DOLLAR
Formats a number as currency text.
The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.
Syntax
=DOLLAR(number, [decimals])
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
number | number | Required | — |
decimals | number | Optional | 2 |
Return type
Can return text.
Remarks
- Default decimal places is
2when omitted. - Negative values are rendered in parentheses, such as
($1,234.00). - Uses comma group separators and dollar symbol.
- Input coercion failures or propagated errors return an error.
Examples
Format a positive amount using the default number of decimal places.
Formula =DOLLAR(1234.567)
Expected result $1,234.57
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Format a negative amount with one decimal digit.
Formula =DOLLAR(-1234.567,1)
Expected result ($1,234.6)
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Format zero with no decimal digits.
Formula =DOLLAR(0,0)
Expected result $0
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
The amount cannot be read from nonnumeric text.
Formula =DOLLAR("amount",2)
Expected result #VALUE!
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Default currency formatting
Formula =DOLLAR(1234.5)
Expected result $1,234.50
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Negative value with zero decimals
Formula =DOLLAR(-999.4, 0)
Expected result ($999)
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Related functions
FAQ
How are negative numbers displayed?
Negative results are formatted in parentheses, for example ($1,234.00).