Documentation/Calc Functions/DOLLAR

Function name:
DOLLAR

Category:
Text

Summary:
Converts a number into text, expressing that number as currency in the local currency format. The number is rounded to a specified number of decimal places.

Syntax:
DOLLAR(Value [; Decimals])

Returns:
Returns a text string expressing the given number as currency in the local currency format.

Arguments:
Value is a real number or a reference to a cell containing that number, which is the value to be converted.

Decimals is an integer or a reference to a cell containing an integer, which is the number of decimal places to be used in the returned text. If Decimals is omitted, a default value of 2 is used. If Decimals is positive, the fractional part of Value will be rounded to the specified number of decimal places. If Decimals is negative, the integer part of Value will be rounded to the left of the decimal point.


 * If either Value or Decimals are non-numeric, then DOLLAR reports a #VALUE! error.
 * If Decimals is a non-integer value, then DOLLAR uses its floor value.
 * If the floor value of Decimals is less than -15 or greater than 15, then DOLLAR reports an invalid argument error (Err:502).

Additional details:
The operation of DOLLAR depends on locale settings and so it should not be regarded as portable.

Examples:
Unless otherwise stated, the results for the following examples assume that:


 * The English (USA) locale setting is selected.
 * Default – USD is selected as the default currency.
 * The option to set the decimal separator key to Same as locale setting has been selected.

Related LibreOffice functions:
TEXT

ODF standard:
Section 6.20.7, part 2

Equivalent Excel functions:
DOLLAR