informix
INFORMIX-GLS Programmer's Manual
Data Formatting

Locale-Specific Data Formats

The format in which data appears within an application when it is in literal strings or character variables is called the end-user format. End-user formats are locale specific: different countries use different formats for numeric, monetary, date, and date/time data. The GLS locale file defines locale-specific formats for each of these types of data, as the following table shows.

Type of Data Locale-File Category SQL Built-In Data Types
Numeric LC_NUMERIC DECIMAL, INT8, INTEGER, SMALLINT, FLOAT, SMALLFLOAT
Monetary LC_MONETARY MONEY
Date and Time LC_TIME DATE, DATETIME

Tip: For more information on the end-user formats that this chapter describes, see the "Informix Guide to GLS Functionality."

LC_NUMERIC Locale-File Category

The LC_NUMERIC locale-file category is the section within a GLS locale file that defines the locale-specific formats for strings that contain numeric data. Numeric data is considered to be all values that contain digits except monetary data. Therefore, integer, fixed-point, and floating-point numbers are all considered numeric data. Strings of numeric data are called number strings.

Tip: In the "Informix Guide to GLS Functionality," the LC_NUMERIC locale-file category is sometimes referred to as the NUMERIC locale category. This manual uses LC_NUMERIC as the category name for numeric data.

The LC_NUMERIC category of each locale file contains subcategories that define the different numeric formats for that locale. The following table lists the numeric formats and their corresponding LC_NUMERIC subcategory.

Numeric Format LC_NUMERIC Subcategory
Numeric decimal separator decimal_point
Numeric thousands separator thousands_sep
Numeric grouping information (number of numeric digits to group together before inserting a thousands separator) grouping
Numeric positive sign num_positive_sign
Numeric negative sign num_negative_sign

LC_MONETARY Locale-File Category

The LC_MONETARY locale-file category is the section within a GLS locale file that defines the locale-specific formats for strings that contain monetary data. Monetary data is considered to be values that contain digits and that represent units of some currency. Therefore, only fixed-point numbers can be monetary data. All other types of numbers (such as integer and floating-point) are considered to be numeric data. Strings of monetary data are called money strings.

Tip: In the "Informix Guide to GLS Functionality," the LC_MONETARY locale-file category is sometimes referred to as the MONETARY locale category. This manual uses LC_MONETARY as the category name for monetary data.

The LC_MONETARY category of each locale file contains subcategories that define the different monetary formats for that locale. The following table lists the monetary formats and their corresponding LC_MONETARY subcategory.

Monetary Format LC_MONETARY Subcategory
International currency symbol (in accordance with the ISO 4217:1987 standard) int_curr_symbol
National (local) currency symbol currency_symbol
Monetary decimal separator mon_decimal_point
Monetary thousands separator mon_thousands_sep
Monetary grouping information (number of monetary digits to group together before inserting a thousands separator) mon_grouping
Monetary positive sign positive_sign
Monetary negative sign negative_sign
Number of fractional digits (those to the right of the decimal separator) to use in the international monetary format int_frac_digits
Number of fractional digits (those to the right of the decimal separator) to use in the national (local) monetary format frac_digits
Whether the currency symbol precedes or follows the monetary value p_cs_precedes, n_cs_precedes
Whether to separate the currency symbol from the monetary value with a space p_sep_by_space, n_sep_by_space
Position of positive and negative signs in a monetary value p_sign_posn, n_sign_posn

Tip: The DBMONEY environment variable can also specify formats for locale-specific formats for money strings.

For definitions of any of these monetary formats (such as currency symbol, decimal separator, or thousands separator) and more information on the DBMONEY environment variable, see the Informix Guide to GLS Functionality.

LC_TIME Locale-File Category

The LC_TIME locale-file category is the section within a GLS locale file that defines the locale-specific formats for strings that contain date and time data. Such strings are called date strings (which contain only date data) or date/time strings (which contain date and time data).

Tip: In the "Informix Guide to GLS Functionality," the LC_TIME locale-file category is sometimes referred to as the TIME locale category. This manual uses LC_TIME as the category name for date and time data.

The LC_TIME category of each locale file contains subcategories that define the different date and time formats. The following table lists the available formats and their corresponding LC_TIME subcategory.

Date/Time Format LC_TIME Subcategory
Abbreviated weekday names abday
Full weekday names day
Abbreviated month names abmon
Full month names mon
Date representation d_fmt
Time representation t_fmt
Date/time representation d_t_fmt
A.M. and P.M. equivalents am_pm
Representation of date/time with A.M. and
P.M. indicators
t_fmt_ampm
Era names era
Representation of date with eras era_d_fmt
Representation of time with eras era_t_fmt
Representation of date/time with eras era_d_t_fmt
Alternative digits to use in date and time strings alt_digits

Tip: The GL_DATE, GL_DATETIME, DBDATE, and DBTIME environment variables can also specify formats for locale-specific formats for date and time strings.

For definitions of any of these date or time formats (such as eras) and information on related environment variables, see the Informix Guide to GLS Functionality.


INFORMIX-GLS Programmer's Manual, Version 3.08
Copyright © 1999, Informix Software, Inc. All rights reserved