Formatting: Using Data Styles and Numeric Formats

1. Overview

GS‑Base supports a variety of built‑in numeric styles, each with its own configurable options. These styles control how numbers, dates, times, percentages, fractions, and scientific values are displayed.

You can use the following standard numeric styles and their options:

Default

General

Currency

Accounting

Date

Time

Date/Time

Percent

Fraction

Scientific

2. User‑Defined Numeric Formats

You can define your own numeric formats by entering a custom style pattern in the Style dialog. Custom formats can be saved as new user styles for reuse.

To understand user‑defined formats, it helps to see how standard formats are constructed. For example, the accounting format is:

_(\$* #,##0.00_);"($"* #,##0.00\);_(\$* \-??_);_(@_)

A fraction format with a fixed denominator of 4 can be defined as:

?\ ?/\4

3. Conditional Formatting with Colors

User‑defined formats allow you to specify font colors for numbers that meet certain conditions. For example:

[green]#.#;[red]\-#.#;[blue]#.#;[gray]@

This displays:

Another example:

[red][<10]#0.00;[yellow][<=50]#0.0;[green][<400]##0;[magenta][>=400]#00

This displays:

Color values may be expressed as RGB values. For example:

[red][<10]#0.00 is equivalent to [#FF0000][<10]#0.00

You may also use one of the following predefined color names:

black[#000000]maroon[#800000]
green[#008000]olive[#808000]
navy[#000080]purple[#800080]
teal[#008080]gray[#808080]
silver[#C0C0C0]red[#FF0000]
lime[#00FF00]yellow;[#FFFF00]
blue[#0000FF]fuchsia[#FF00FF]
aqua[#00FFFF]white[#FFFFFF]