Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Text /
Appendix B - International Resources / Numeric-Format Resource (Type 'itl0')


The Intl0Rec Data Type

You can access the numeric-format resource through the Intl0Rec data type.

TYPE  Intl0Rec =
   PACKED RECORD
      decimalPt:     Char;    {decimal point character}
      thousSep:      Char;    {thousands separator}
      listSep:       Char;    {list separator}
      currSym1:      Char;    {currency symbol}
      currSym2:      Char;    
      currSym3:      Char;    
      currFmt:       Byte;    {currency format flags}
      dateOrder:     Byte;    {order of short date elements}
      shrtDateFmt:   Byte;    {short date format flags}
      dateSep:       Char;    {date separator}
      timeCycle:     Byte;    {time cycle:0-23, 0-11, or 12-11}
      timeFmt:       Byte;    {time format flags}
      mornStr:       PACKED ARRAY[1..4] OF Char;   {trailing }
                              { string for first 12-hour cycle}
      eveStr:        PACKED ARRAY[1..4] OF Char;   {trailing }
                              { string for last 12-hour cycle}
      timeSep:       Char;    {time separator}
      time1Suff:     Char;    {trailing string for morning }
      time2Suff:     Char;    { part of 24-hour cycle}
      time3Suff:     Char;    
      time4Suff:     Char;    
      time5Suff:     Char;    {trailing string for afternoon }
      time6Suff:     Char;    { part of 24-hour cycle}
      time7Suff:     Char;    
      time8Suff:     Char;    
      metricSys:     Byte;    {255 if metric, 0 if not}
      intl0Vers:     Integer; {version information}
   END;
   Intl0Ptr       = ^Intl0Rec;
   Intl0Hndl      = ^Intl0Ptr;
Note
A NULL character (ASCII code 0) in a field of type Char means that no such character exists. The currency symbol and the trailing string for the 24-hour cycle are separated into individual Char fields because of Pascal packing conventions. All strings include any required spaces.
Field Description
decimalPt
Part of the number format definition. The1-byte character that appears before the decimal representation of a fraction with a denominator of 10. In the United States, this format is a period. In several European countries, it is a comma.
thousSep
Part of the number format definition. The 1-byte character that separates every three digits to the left of the decimal point. In the United States, this format is a comma. In several European countries, it is a period.
listSep
Part of the number format definition. The 1-byte character that separates numbers, as when a list of numbers is entered by the user; it must be different from the decimal point character. If it's the same as the thousands separator, the user must not include the latter in entered numbers. In the United States, this format is a semicolon. In the United Kingdom, it is a comma.
currSym1
Part of the currency format definition. The initial byte used to indicate currency. One character is sufficient for the United States ($) and United Kingdom ().
currSym2
Part of the currency format definition. The second byte used to indicate currency. Two characters are required for France (Fr).
currSym3
Part of the currency format definition. The third byte used to indicate currency. Three characters are required for Italy (Li.) and Germany (DM.).
currFmt
Part of the currency format definition. The four least significant bits are unused. The four most significant bits are Boolean values. Bit 7 determines whether there is a leading integer zero; for example, a 1 in this field specifies a format like 0.23, whereas a 0 specifies .23.
Bit 6 determines whether there are trailing decimal zeros; for example, a 1 in this field specifies a format like 325.00, whereas a 0 specifies 325. Bit 5 determines whether to use a minus sign or parentheses to denote a negative currency amount; for example,
a 1 in this field specifies a format like -0.45, whereas a 0 specifies (0.45). Bit 4 determines whether the currency symbol trails or leads; for example, a value of 1 in this field specifies a format like the $3.00 used in the United States, whereas a value of 0 specifies the
3 DM. used in Germany.
You can use the following predefined constants as masks to set or test the bits in the currFmt field:
 ConstantValueExplanation
 currSymLead16Currency symbol leads
 currNegSym32Use minus sign for negative
 currTrailingZ64Use trailing decimal zeros
 currLeadingZ128Use leading integer zero
Note
You can also apply the currency format's leading-zero and trailing-zero indicators to the number format if desired.
dateOrder
Part of the short date format definition. Defines the order of the elements (month, day, and year) of the short date format. The order varies from region to region--for example, 12/29/72 is a common order in the United States, whereas 29.12.72 is common in Europe.
You can indicate the order of the day, month, and year with the following constants:
 ConstantValueExplanation
 mdy0Month-day-year
 dmy1Day-month-year
 ymd2Year-month-day
 myd3Month-year-day
 dym4Day-year-month
 ydm5Year-day-month
shrtDateFmt
Part of the short date format definition. The five least significant bits are unused. The three most significant bit fields are Boolean values that determine whether to show the century, and whether to show leading zeros in month and day numbers. For example, if the first bit is set to 1 it specifies a date format like 10/21/1917, and set to 0 specifies the format 10/21/17. The second bit set to 1 specifies a format like 05/23/84, and set to 0 specifies the format 5/23/84. The third bit set to 1 specifies a format like 12/03/46, and set to 0 specifies the format 12/3/46.
To set or test the bits in the shrtDateFmt field, you can use the following predefined constants as masks:
 ConstantValueExplanation
 dayLdingZ32Show leading zero for day
 mntLdingZ64Show leading zero for month
 century128Show century
dateSep
Part of the short date format definition. The 1-byte character that separates the different parts of the date. For example, in the United States this character is a slash (12/3/46), in Italy it is a hyphen (3-12-46), and in Japan it is a decimal point (46.12.3).
timeCycle
Part of the time format definition. Indicates the time cycle--that is, whether to use 12 or 24 hours as the basis of time, and whether to consider midnight and noon to be 12:00 or 0:00. You can use the following predefined constants to specify the time cycle:
 ConstantValueExplanation
 timeCycle240Use 24-hour format
(midnight = 0:00)
 timeCycleZero1Use A.M./P.M. format
(midnight and noon = 0:00)
 timeCycle12255Use A.M./P.M. format
(midnight and noon = 12:00)
timeFmt
Part of the time format definition. Indicates whether to show leading zeros in time representation. Bit 5 determines whether there are leading zeros in seconds; for example, a value of 1 in this field specifies a format like 11:15:05, whereas a 0 specifies the format 11:15:5. Bit 6 determines whether there are leading zeros in minutes; for example, a value of 1 in this field specifies a format like 10:05, whereas a 0 specifies the format 10:5. Bit 7 determines whether there are leading zeros in hours; for example, a value of 1 in this field specifies a format like 09:15, whereas a 0 specifies the format 9:15.
You can use the following predefined constants as masks for setting or testing bits in the time format field:
 ConstantValueExplanation
 secLeadingZ32Use leading zero for seconds
 minLeadingZ64Use leading zero for minutes
 hrLeadingZ128Use leading zero for hours
mornStr
Part of the time format definition. A string of up to 4 bytes to follow the time to indicate morning (for example, " AM"). Typically, the string includes a leading space.
eveStr
Part of the time format definition. A string of up to 4 bytes to follow the time to indicate evening (for example, " PM"). Typically, the string includes a leading space.
timeSep
Part of the time format definition. The 1-byte character that is the time separator (for example, the colon).
time1Suff, time2Suff, time3Suff, time4Suff
Part of the time format definition. A trailing string of up to 4 bytes for the morning part of the 24-hour cycle. For example, the German string "uhr" can be stored here.
time5Suff, time6Suff, time7Suff, time8Suff
Part of the time format definition. A trailing string of up to 4 bytes for the evening part of the 24-hour cycle. Typically, this string duplicates the string contained in time1Suff through time4Suff. For example, the German string "uhr" can be stored here.
metricSys
The unit-of-measure definition. Indicates whether to use the metric system. If 255, the metric system is used; if 0, metric is not used.
intl0Vers
Region code and version number. The code number of the region that this resource applies to is in the high-order byte, and the version number of this numeric-format resource is in the
low-order byte.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996