The number formatting engine in Gnumeric is very powerful: it can be used to display numbers in various formats as well as providing the user with the ability to specify colors based on various simple conditions.
Example 5-1 The available catagories of pre-defined formats are :
Example 5-1. Number 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's estimate 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
parenthises, or turning Red. 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 Is very similar to Number, with the addition of a
currency symbol. Currently known symbols include '$'
and the three letter abreviations of a ll major
currencies.
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 that align with negatives.
ie
' 600.123 ' : Note the spaces for the positive number
'-500.456 ' : in 1 format for negatives.
'(500.456)' : in another.
Date The various permutations and combinations of
predefined date representations big to expose the
underlying format specification language
Example 5-3
The short version is that years can be 2 or 4 digit
(yy or yyyy). Months can be as many digits as needed
(m), always 2 digits (mm), or as the short form (mmm).
Days can be as many digits as needed (d) or two digits
(dd). The various other characters offer a choice of
separators.
Time As with dates predefined time formats are selected
using their specification. Hours (h), minutes (mm),
seconds (ss). 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 (ie 25 hours instead of 1day +
1hour). For that instance you can use '[h]', '[m]' or
'[s]'.
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
and 0-30 digits after the decimal place. No provision
for controling 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.
Custom This provides a list of the format specifications for
all predefined formats and allows a user to enter
create new specialized types.
Example 5-2 is an example of some of the many variations of formatting one can apply to a number with the preset formats.