The Excel Dollar function rounds a supplied number to a specified number of decimal places and then converts this into a text string with a currency format.
The currency format used is the format that is set as the default on your computer.
The syntax of the Excel Dollar function is:
Where the function arguments are as follows:
number    The number to be converted into a text string. 
[decimals]   
An optional numeric argument that specifies the number of decimal places to be displayed after the decimal point. Note:

The following spreadsheet shows the Excel Dollar Function, used to convert the number 123.591 to a text representation of a currency, rounded to different numbers of decimal places.
Formulas:

Results:

Note that, in cell A1 of the above spreadsheet, the [decimals] argument is omitted from the Dollar function, so the default value of 2 is used.
See the Microsoft Office website for further examples of the Excel Dollar function.
If you get an error from the Excel Dollar Function, this is likely to be the #VALUE! error:
#VALUE!    Occurs either of the supplied arguments are nonnumeric. 
Some users encounter the following problem when using the Excel Dollar function:
Once a number has been converted, using the Excel Dollar function, it is stored in Excel as text. Therefore, it cannot be used in numeric calculations.
If you want to be able to use your currency values in calculations, you should not use the Excel Dollar function. Instead, you should simply change the formatting of the original number into a currency format.
The easiest way to do this is to select the Currency formatting button on the Excel ribbon. This is generally located in the 'Number' group, on the Home tab of the ribbon (see below):
For further details of Excel Formatting, see the Excel formatting page.