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 / Converting Between Strings and Floating-Point Numbers


ExtendedToString

The ExtendedToString function converts an internal floating-point representation of a number into a string that can be presented to the user.

FUNCTION ExtendedToString(x: Extended80;
                          myFormatRec: NumFormatStringRec; 
                          partsTable: NumberParts;
                          VAR outString: Str255): FormatStatus;
x
A floating-point value in 80-bit SANE representation.
myFormatRec
The internal representation of the formatting information for numbers, as produced by the StringToFormatRec function.
partsTable
A record obtained from the tokens ('itl4') resource that shows the correspondence between generic number part separators (tokens) and their localized version (for example, a thousand separator is a comma in the United States and a decimal point in France).
outString
On output, contains the number formatted according to the information in myFormatRec.
DESCRIPTION
ExtendedToString creates a string representation of a floating-point number, using the formatting information in the myFormatRec parameter (which was created by a previous call to StringToFormatRec) to determine how the number should be formatted for output. It uses the number parts table to determine the component parts of the number string.

StringToFormatRec returns a value of type FormatStatus that denotes the confidence level for the conversion that it performed. The low byte of the FormatStatus value is of type FormatResultType, the values of which are described in Table 5-6 on page 5-38.

IMPORTANT
Be sure to cast the result of ExtendedToString to a type FormatResultType before working with it.
ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the ExtendedToString function are
Trap macroSelector
_ScriptUtil$8210 FFE8

SEE ALSO
For comprehensive details on the number parts table, see the description of the tokens ('itl4') resource in the appendix "International Resources" in this book.

To obtain a handle to the number parts table from a tokens resource, use the GetIntlResourceTable procedure, which is described in the chapter "Script Manager" in this book.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996