The Gnumeric Manual
Prev | Chapter 9. Cell Formatting | Next

# 9.2. Number Formatting Tab

This tab allows you to select the format for the cell's contents. You can select one of the many preset formatting styles which should be be more than adequate for the vast majority of cases. If none of these meet the needs of the user, it is possible to create your own formats.

To use one of the preset formats, select the format category (such as Number or Date) by clicking on the corresponding radiobutton in the left side of the dialog. The right side of the dialog will show you how the selected cell would look with this format and give more options for the selected format.

The following is a list of all available format categories:

General

  A swiss army knife of a format. It will attempt to display a value it the 'best' way possible. The choice of format depends on the size of the cell and Gnumeric guess of what 'type' of value is being displayed (number, date, time ...).

Number

  Displays numbers with 0-30 digits after the decimal place. Negatives can be displayed normally, within parentheses, or in red color. Optionally a delimiter can be added every third order of magnitude (thousand, million, ...). Both the decimal point and the thousands separator have internationalization support.

Currency

  Similar to Number, with the addition of a currency symbol. Currently known symbols include `$`, `¥`, `£`, `¤` and the three letter abbreviations of all major currencies. By default, Gnumeric will use currency symbol and placement (before or after the number) appropriate for your locale.

Accounting

  A specialization of Currency which pays more attention to the alignment of negative numbers. It ensures that a small amount of space is prepended to positive numbers so that they align with negatives.

Date

  This category contains various formats for presenting dates. By default, Gnumeric will use date format appropriate for your locale (country and language setting). You can also choose one of many possible date formats shown in the list in the right side of the dialog. The following is an explanation of codes used in these formats:

  - d: day of month (one or two digits). Example: 9.

  - dd: day of month (two digits). Example: 09.

  - ddd: day of week. Example: Wed.

  - m: month (number, one or two digits). Example: 3.

  - mm: month (number, two digits). Example: 03.

  - mmm: month (abbreviated name). Example: Mar.

  - mmmm: month (full name). Example: March.

  - yyyy: year (four digits). Example: 1967.

  - yy: last two digits of year. Example: 67.

  Some date formats also include time using the codes explained below. Examples of date formatting are shown in Table 9-1.
Time

  This category contains various formats for presenting time of day. You can choose one of many possible time formats shown in the list in the right side of the dialog. The following is an explanation of codes used in these formats:

  - h: hours.

  - mm: minutes.

  - ss: seconds.

  Sometimes it is necessary to display more than 24 hours, or more that 60 minutes/seconds without the values incrementing the display unit of the next larger measure (e.g., 25 hours instead of 1 day + 1 hour). To achieve this, use codes '[h]', '[mm]', and '[ss]'. Examples of time formatting are shown in Table 9-2.
Percentage

  Multiplies a value by 100 and appends a percent. Can be used with 0-30 digits after the decimal place.

Fractions

  Approximate the value with a rational number with either a specific denominator or with a maximum number of digits in the denominator.

Scientific

  Formats the value using scientific notation, e.g. `5.334 E 6` for `5,334,000`. Allows up to 30 digits after the decimal place. No provision for controlling the exponent are provided at this time.

Text

  Treats numeric values as text. This will show a number with as much precision as available and will lose knowledge of whether it represented a date, or time.

  | TIP
  | If your workbook contains serial numbers, ID numbers or other similar entries, choose Text format for them. If you choose General or Number format, Gnumeric will remove leading zeros, so that `01124` will be shown as `1124`.

Custom

  This category allows you to define your own format. This is only recommended for advanced users as it requires understanding of the codes internally used by Gnumeric for describing formats. To make it easier, this category provides a list of codes for all predefined formats so you can create our own format by modifying one of them rather than starting from scratch.

Table 9-1. Examples of Date Formats

Format | Sample
--- | ---
General | 36068.755
m/d/yy | d/m/yy | 9/30/98 | 30/9/98
m/d/yyyy | d/m/yyyy | 9/30/1998 | 30/9/1998
d-mmm-yy | mmm-d-yy | 30-Sep-98 | Sep-30-98
d-mmm-yyyy | mmm-d-yyyy | 30-Sep-199 | Sep-30-9198
d-mmm | mmm-d | 30-Sep | Sep-30
d-mm | mm-d | 30-09 | 09-30
mmm/d | d/mmm | Sep/30 | 30/Sep
mm/d | d/mm | 09/30 | 30/09
mm/dd/yy | dd/mm/yy | 09/30/98 | 30/09/98
mm/dd/yyyy | dd/mm/yyyy | 09/30/1998 | 30/09/1998
mmm/dd/yy | dd/mmm/yy | Sep/30/98 | 30/Sep/98
mmm/dd/yyyy | dd/mmm/yyyy | Sep/30/1998 | 30/Sep/1998
mmm/ddd/yy | ddd/mmm/yy | Sep/Wed/98 | Wed/Sep/98
mmm/ddd/yyyy | ddd/mmm/yyyy | Sep/Wed/1998 | Wed/Sep/1998
mm/ddd/yy | ddd/mm/yy | 09/Wed/98 | Wed/09/98
mm/ddd/yyyy | ddd/mm/yyyy | 09/Wed/1998 | Wed/09/1998
mmm-yy | Sep-98
mmm-yyyy | Sep-1998
mmmm-yy | September-98
mmmm-yyyy | September-1998
d/m/yy h:mm | m/d/yy h:mm | 9/30/98 18:07 | 30/9/98 187:07
d/m/yyyy h:mm | m/d/yyyy h:mm | 9/30/1998 18:07 | 30/9/1998 187:07
yyyy/mm/d | 1998/09/30
yyyy/mmm/d | 1998/Sep/30
yyyy/mm/dd | 1998/09/30
yyyy/mmm/dd | 1998/Sep/30
yyyy-mm-d | 1998-09-30
yyyy-mmm-d | 1998-Sep-3
yyyy-mm-dd | 1998-09-30
yyyy-mmm-d | 1998-Sep-30
yy | 98
yyyy | 1998

Table 9-2. Examples of Time Formats

Format | Sample
--- | ---
General | 36068.755
h:mm AM/PM | 6:07 PM
h:mm:ss AM/PM | 6:07:12 PM
h:mm | 18:07
h:mm:ss | 18:07:12
m/d/yy h:mm | 9/30/98 18:07
d/m/yy h:mm | 30/9/98 18:07
mm:ss | 07:12
[h]:mm:ss | 865650:07:12
[h]:mm | 865650:07
[mm]:ss | 51939007:12
[ss] | 3116340432

Prev | Home | Next
Cell Formatting | Up | Alignment, Font, Border, and Background Tabs