FIXED

The FIXED function rounds a real number to a number of decimal places and converts it to text.

Syntax

FIXED(
    number,
    decimals,
    no_commas
)

Parameters
  • number: Real number to round and convert to text.
  • decimals: Optional argument. Number of decimal places to display in the returned value.
  • no_commas: Optional argument. Logical value: If it takes the value 0 or is omitted, the function returns the number with thousands separator in text format. If it takes the value 1, the thousands separator will not be displayed. If you want to configure this option, you must necessarily include the number of decimal places to display (it is not possible not to include the second argument and include this one).
Returned value

The FIXED function returns a text string.

Additional Information

In addition to integer and positive numeric values, the decimals argument can take non-numeric values: If it takes the value True, one decimal will be displayed. If it takes the value False or Blank, decimals will not be displayed. If it is a decimal number, it is rounded to the nearest integer. Thus, including the number 1.6 as an argument will cause two decimal places to be displayed, and including the number 1.4 as an argument will cause a single decimal to be displayed:

FIXED function: Example of use

If decimals is a negative number, number will be rounded to the left of the decimal point, that is, to the nearest value of N*10*abs(decimals) . Thus, if number takes the value 999 and decimals takes the value -1, the result of the function will be the rounding of 999 to the nearest value of N*10: 1,000. The results for various combinations of arguments are shown in the following table:

FIXED function: Example of use

If decimals is omitted, 2 decimal places will be displayed. Keep in mind that the function rounds number to the indicated number of decimal places (it does not truncate it).

As mentioned, if no_commas takes the value 0 or is omitted, the result will include thousands separator, and will not include it if it takes the value 1:

FIXED function: Example of use

The numbers to be converted cannot have more than 15 significant digits (starting from the sixteenth digit, counting from left to right, it is rounded with zeros), but they can be displayed with up to 127 decimal places (one more decimal place causes an error).

Category
Text
Submitted by admin on Mon, 12/03/2018 - 23:57