WorksheetFunction.Fixed method (Excel)

Rounds a number to the specified number of decimals, formats the number in decimal format using a period and commas, and returns the result as text.

Syntax

expression.Fixed (Arg1, Arg2, Arg3)

expression A variable that represents a WorksheetFunction object.

Parameters

Name Required/Optional Data type Description
Arg1 Required Double Number - the number you want to round and convert to text.
Arg2 Optional Variant Decimals - the number of digits to the right of the decimal point.
Arg3 Optional Variant No_commas - a logical value that, if True, prevents Fixed from including commas in the returned text.

Return value

String

Remarks

Numbers in Microsoft Excel can never have more than 15 significant digits, but decimals can be as large as 127.

If decimals is negative, number is rounded to the left of the decimal point.

If you omit decimals, it is assumed to be 2.

If no_commas is False or omitted, the returned text includes commas as usual.

The major difference between formatting a cell containing a number with the Cells command (Format menu) and formatting a number directly with the Fixed function is that Fixed converts its result to text. A number formatted with the Cells command is still a number.

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.