DOLLAR
Converts a number to text, using a currency format $#.##.
Syntax
expression.DOLLAR(arg1, arg2);
expression
- A variable that represents a ApiWorksheetFunction class.
Parameters
Name | Required/Optional | Data type | Default | Description |
---|---|---|---|---|
arg1 | Required | ApiRange | ApiName | number | string | A number, a reference to a cell containing a number, or a formula that returns a number. | |
arg2 | Optional | ApiRange | ApiName | number | A number of digits to the right of the decimal point. The number is rounded as necessary.\ If it is omitted, the function will assume it to be 2. |
Returns
string
Example
- Code
- Result
let worksheet = Api.GetActiveSheet();
let func = Api.GetWorksheetFunction();
worksheet.GetRange("A1").SetValue(func.DOLLAR(98.9997, 3));