Converts a number to text using currency format, with the decimals rounded to the specified place. The format used is $#,##0.00_);($#,##0.00).
Number is a number, a reference to a cell containing a number, or a formula that evaluates to a number.
Decimals is the number of digits to the right of the decimal point. If decimals is negative, number is rounded to the left of the decimal point. If you omit decimals, it is assumed to be 2.
The major difference between formatting a cell that contains a number with the Cells command (Format menu) and formatting a number directly with the DOLLAR function is that DOLLAR converts its result to text. A number formatted with the Cells command is still a number. You can continue to use numbers formatted with DOLLAR in formulas, because Microsoft Excel converts numbers entered as text values to numbers when it calculates.
DOLLAR(1234.567, 2) equals "$1,234.57"
DOLLAR(1234.567, -2) equals "$1,200"
DOLLAR(-1234.567, -2) equals "($1,200)"
DOLLAR(-0.123, 4) equals "($0.1230)"
DOLLAR(99.888) equals "$99.89"