Custom Number Format Codes

Choose a Custom number display format in the Edit Format dialog box to choose from predefined custom number formats or to create your own custom number format.

In order to create a custom number format, you must use the correct syntax.

  • To format numbers with decimal points, include placeholders (such as #) in a section as per the following table.
  • If the number has more digits to the right of the decimal point than there are placeholders in the format, the number is rounded to as many decimal places as there are placeholders.
  • If the number has more digits to the left of the decimal point than there are placeholders in the format, the extra digits are displayed.
  • If the format contains only number signs (#) to the left of the decimal point, numbers less than 1 begin with a decimal point.
    Use syntax symbol To display
    # only significant digits and not insignificant zeroes
    0 (zero) insignificant zeroes if a number has fewer digits than there are zeroes in the format
    , a comma; for example, in order to display a comma as a thousands separator

The following examples use a combination of syntax symbols:

To display Use this custom number format code
6.7 as 6.700 #.000
5555 as 5,555 #,### or #,##0
1405.89 as 1405.9 ####.#

See also: Spreadsheet Data Types, Spreadsheet Display Formats, and Range of Numeric Values That Can Be Entered or Stored in Cells.