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 /
Chapter 5 - Text Utilities / Text Utilities Reference
Routines


Using Number Format Specification Strings for International Number Formatting

To allow for all of the international variations in numeric presentation styles, you need to include in your routine calls a number parts table from a tokens ('itl4') resource. You can usually use the number parts table in the standard tokens resource that is supplied with the system. You also need to define the format of input and output numeric strings, including which characters (if any) to use as thousand separators, whether to indicate negative values with a minus sign or by enclosing the number in parentheses, and how to display zero values. These details are specified in number format specification strings, the syntax of which is described in the section "Using Number Format Specification Strings," beginning on page 5-39.

To make it possible to map a number that was formatted for one specification into another format, the Macintosh Operating System defines an internal numeric representation that is independent of region, language, and other multicultural considerations: the NumFormatStringRec record. This record is created from a number format specification string that defines the appearance of numeric strings. Its use is summarized in Figure 5-12 on page 5-37.

In brief, what you have to do is create a number format specification string that you want to use and convert that string into a NumFormatStringRec record. The Text Utilities include two routines for this purpose:


Subtopics
StringToFormatRec
FormatRecToString

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996