CHAPTER 19 - PART 2
Formatting and Displaying Dates, Times, and Numbers
Preamble - The Text Utilities and International Resources
The Text Utilities
The Text Utilities are a collection of text-handling functions provided by the system software which allow you to specify strings for various purposes, sort strings, convert case or strip diacritical marks from text for sorting purposes, search and replace text, find word boundaries and line breaks when laying out lines of text, and format numbers, currency, dates, and times. The following is concerned only with the latter, that is, formatting numbers, currency, dates, and times.
International Resources
Many Text Utilities functions utilise the international resources, which define how different text elements are represented depending on the script system in use. The international resources relevant to formatting numbers, currency, dates, and times are as follows:
- Numeric Format Resource. The numeric format ('itl0') resource contains short date and time formats, and formats for currency, numbers, and the preferred unit of measurement. It provides separators for decimals, thousands, and lists. It also contains the region code for this particular resource. Three of the several variations in short date and time formats are as follows:
System Software |
Morning |
Afternoon |
Short Date |
United States |
1:02 AM |
1:02 PM |
2/1/90 |
Sweden |
01:02 |
13:02 |
90-01-01 |
Germany |
1:02 Uhr |
13:02 Uhr |
2.1.1990 |
- Long Date Format Resource. The long date format ('itl1') resource specifies the long and abbreviated date formats for a particular region, including the names of days and months and the exact order of presentation of the elements. It also contains a region code for this particular resource. Three of the several variations of the long and abbreviated date formats are as follows:
System Software |
Abbreviated Date |
Long Date |
United States |
Tue, Jan 2, 1990 |
Tuesday, January 2 1990 |
French |
Mar 2 Jan 1990 |
Mardi 2 Janvier 1990 |
Australian |
Tue, 2 Jan 1990 |
Tuesday, 2 January 1990 |
- Tokens Resource. The tokens ('itl4') resource contains, amongst other things, a table for formatting numbers. This table, which is called the number parts table, contains standard representations for the components of numbers and numeric strings. As will be seen, certain Text Utilities number formatting functions use the number parts table to create number strings in localised formats.
Date and Time
The Text Utilities functions which work with dates and times use information in the international resources to create different representations of date and time values. The Operating System provides functions that return the current date and time in numeric format. Text Utilities functions can then be used to convert these values into strings which can, in turn, be presented in the different international formats.
Date and Time Value Representations
The Operating System provides the following differing representations of date and time values:
Representation |
Description |
Standard date-time value. |
A 32-bit integer representing the number of seconds between midnight, 1 January 1904 and the current time. |
Long date-time value. |
A 64-bit signed representation of data type LongDateTime.
Allows for coverage of a longer time span than the standard date-time value, specifically, about 30,000 years. |
Date-time structure. |
Data type DateTimeRec. Includes integer fields for year, month, day, hour, minute, second, and day of week. |
Long date-time structure |
Data type LongDateRec. Similar to the date-time structure, except that it adds several additional fields, including integer values for the era, day of the year, and week of the year. Allows for a longer time span than the date-time structure. |
The date-time (DateTimeRec) and the long date-time (LongDateRec) structures are as follows:
union LongDateRec
{
struct
struct DateTimeRec {
} short era;
short year; short year;
short month; short month;
short day; short day;
short hour; short hour;
short minute; short minute;
short second; short second;
short dayOfWeek; short dayOfWeek;
}; short dayOfYear;
short weekOfYear;
typedef struct DateTimeRec DateTimeRec; short pm;
short res1;
short res2;
short res3;
} ld;
short list[14];
struct
{
short eraAlt;
DateTimeRec oldDate;
} od;
};
typedef union LongDateRec LongDateRec;
Obtaining Date-Time Values and Structures
The Operating System Utilities provide the following two functions for obtaining date-time values and structures.
Function |
Description |
GetDateTime |
Returns a standard date-time value. |
GetTime |
Returns a date-time structure. |
Converting Between Values and Structures
The Operating System provides the following four functions for converting between the different date and time data types:
Function |
Converts |
To |
DateToSeconds |
Date-time structure. |
Standard date-time value. |
SecondsToDate |
Standard date-time value. |
Date-time structure. |
LongDateToSeconds |
Long date structure. |
Long date-time value. |
LongSecondsToDate |
Long date-time value. |
Long date structure. |
Converting Date-Time Values Into Strings
The Text Utilities provide the following functions for converting from one of the numeric date-time representations to a formatted string.
Function |
Description |
DateString |
Converts standard date-time value to a date string formatted according to the specified international resource. |
LongDateString |
Converts long date-time value to a date string formatted according to the specified international resource. |
TimeString |
Converts standard date-time value to a time string formatted according to the specified international resource. |
LongTimeString |
Converts long date-time values to a time string formatted according to the specified international resource. |
Output Format - Date. When you use DateString and LongDateString, you can specify, in the longFlag parameter, an output format for the resulting date string. This format can be one of the following three values of the DateForm enumerated data type:
Value |
Date String Produced (Example) |
Formatting Information Obtained From |
shortDate |
1/31/92 |
Numeric format resource ('itl0'). |
abbrevDate |
Fri, Jan 31, 1992 |
Long date format resource ('itl1'). |
longDate |
Friday, January 31, 1992 |
Long date format resource ('itl1'). |
Output Format - Time. When you use TimeString and LongTimeString, you can request an output format for the resulting time string by specifying either true or false in the wantSeconds parameter. true will cause seconds to be included in the string.
DateString, LongDateString, TimeString and LongTimeString use the date and time formatting information in the format resource that you specify in the resource handle (intlHandle) parameter. If you specify NULL for the value of the resource handle parameter, the appropriate format resource for the current script system is used.
Converting Date-Time Strings Into Internal Numeric Representation
The Text Utilities include functions which can parse date and time strings as entered by users and fill in the fields of a structure with the components of the date and time, including the month, day, year, hours, minutes, and seconds, extracted from the string.
Suppose your application needs to, say, convert a date and time string typed in by the user (for example, "March 27, 1992, 08:14 p.m.") into numeric representation. The following Text Utilities functions may be used to convert the string entered by the user into a long date-time structure:
Function |
Description |
StringToDate |
Parses an input string for a date and creates an internal numeric representation of that date. Returns a status value indicating the confidence level for the success of the conversion.
Expects a date specification, in one of the formats defined by the current script system, at the beginning of the string. Recognizes date strings in many formats, for example: "September 1,1987", "1 Sept 87", "1/9/87", and "1 1987 Sept". |
StringToTime |
Parses an input string for a time and creates an internal numeric representation of that time. Returns a status value indicating the confidence level for the success of the conversion.
Expects a time specification, in a format defined by the current script system, at the beginning of the string.
|
You usually call StringToDate and StringToTime sequentially to parse the date and time values from an input string and fill in these fields. Note that StringToDate assigns to its lengthUsed parameter the number of bytes that it uses to parse the date. Use this value to compute the starting location of the text that you can pass to StringToTime.
The "confidence level" value returned by both StringToDate and StringToTime is of type StringToDateStatus, a set of bit values which have been OR'd together. The higher the resultant number, the lower the confidence level. Three of the twelve StringToDateStatus values, and their meanings, are as follows:
Value |
Meaning |
fataldateTime |
A fatal error occurred during the parse. |
dateTimeNotFound |
A valid date or time value could not be found in the string. |
sepNotIntlSep |
A valid date or time value was found; however, one or more of the separator characters in the string was not an expected separator character for the script system in use. |
Date Cache Structure. Both StringToDate and StringToTime take a date cache structure as one of their parameters. A date cache structure (a data structure of type DateCacheRec) stores date conversion data used by the date and time conversion functions. You must declare a data cache structure in your application and initialise it by calling InitDateCache once, typically in your main program initialisation code.
Numbers
When you present numbers to the user, or when the user enters numbers for your application to use, you need to convert between the internal numeric representation of the number and the output (or input) format of the number. The Text Utilities provide several functions for performing these conversions.
Integers
The simplest number conversion tasks involve integer values. The following Text Utilities functions may be used to convert an integer value to a numeric string and vice versa:
Function |
Description |
NumToString |
Converts a long integer value into a string representation. |
StringToNum |
Converts a string representation of a number into a long integer value. |
The range of values accommodated by these functions is -2,147,483,647 to 2,147,483,648. No comma insertion or other formatting is performed.
Number Format Specification Strings
If you are working with floating point numbers, or if you want to accommodate the possible differences in number output formats for different countries and regions of the world, you need to work with number format specification strings. Number format specification strings define the appearance of numeric strings in your application.
Parts. Each number format specification string contains up to three parts:
- The positive number format.
- The negative number format.
- The zero number format.
Each of these formats is applied to a numeric value of the corresponding type. When the specification string contains only one part, that part is used for all values. When in contains two parts, the first part is used for positive and zero values and the second part is used for negative values.
Elements. A number format specification string can contain the following elements:
- Number parts separators (, and .) for specifying the decimal separator and the thousands separator.
- Literals to be included in the output. (Literals can be strings or brackets, braces and parentheses, and must be enclosed in quotation marks.)
- Digit place holders. (Digit place holders that you want displayed must be indicated by digit symbols. Zero digits (0) add leading zeroes whenever an input digit is not present. Skipping digits (#) only produce output characters when an input digit is present. Padding digits (^) are like zero digits except that a padding character such as a non-breaking space is used instead of leading zeros to pad the output string.)
- Quoting mechanisms for handling literals correctly.
- Symbol and sign characters.
Examples. The following shows several different number format specification strings and the output produced by each:
Number Format Specification String |
Numeric Value |
Output Format |
###,###.##;-###,###.##;0 |
123456.78 |
123,456.78 |
###,###.0##,### |
1234 |
1,234.0 |
###,###.0##,### |
3.141592 |
3.141,592 |
###;(000);^^^ |
-1 |
(001) |
###.### |
1.234999 |
1.235 |
###'CR';###'DB';''zero'' |
1 |
1CR |
###'CR';###'DB';''zero'' |
0 |
'zero' |
##% |
0.1 |
10% |
The number formatting functions always fill in integer digits from the right and decimal places on the left. The following examples, in which a literal is included in the middle of the format strings, demonstrate this behaviour:
Number Format Specification String |
Numeric Value |
Output Format |
###'my'### |
1 |
1 |
###'my'### |
123 |
123 |
###'my'### |
1234 |
1my1234 |
0.###'my'### |
0.1 |
0.1 |
0.###'my'### |
0.123 |
1.123 |
0.###'my'### |
0.1234 |
0.123my4 |
Overflow and Rounding. If the input string contains more digits than are specified in the number format specification string, an error (formatOverflow) will be generated. If the input string contains too many decimal places, the decimal portion is automatically rounded. For example, given the format ###.###, a value of 1234.56789 results in an error condition, and a value of 1.234999 results in the rounded-off value 1.235.
Converting Number Format Specification Strings to Internal Numeric Representations. With the required number format specification string defined, you must then convert the string into an internal numeric representation. The internal representation of format strings is stored in a NumFormatString structure. You use the following functions to convert a number format specification string to a NumFormatString structure and vice versa.
Functions |
Description |
StringToFormatRec |
Converts a number format specification string into a NumFormatString structure. |
FormatRecToString |
Convert a NumFormatString structure back to a number format specification string. |
Number Parts Table. The internal numeric representation allows you to map the number into different output formats. One of the parameters taken by StringToFormatRec is a number parts table. The number parts table specifies which characters are used for certain purposes, such as separating parts of a number, in the format specification string.
 |
For example, a thousands separator is a comma in Australia and a decimal point in France. |
 |
The FormatRecToString function also contains a number parts table parameter. By using a different table than was used in the call to StringToFormatRec, you can produce a number format specification string that specifies how numbers are formatted for a different region of the world. You use FormatRecToString when you want to display the number format specification string to the user for perusal or modification. |
As previously stated, the number parts table is contained in the 'itl4' resource. A handle to the 'itl4' resource may be obtained by a call to GetIntlResourceTable, specifying iuNumberPartsTable in the tableCode parameter.
Converting Between Floating Point Numbers and Numeric Strings
Once you have a NumFormatString structure which defines the format of numbers for a certain region of the world, you can convert floating point numbers into numeric strings and numeric strings into floating point numbers using the following functions:
Functions |
Description |
StringToExtended |
Using a NumFormatString structure and a number parts table, converts a numeric string to an 80-bit floating point value. |
ExtendedToString |
Using a NumFormatString structure and a number parts table, converts an 80-bit floating point number to a numeric string. |
PowerPC Considerations. The PowerPC-based Macintosh follows the IEEE 754 standard for floating point arithmetic. In this standard, float is 32 bits and double is 64 bits. (Apple has added the 128 bit long double type.) However, the PowerPC floating point unit does not support Motorola's 80/96-bit extended type, and neither do the PowerPC numerics. To accommodate this, you can use Apple-supplied conversion utilities to move to and from extended. For example, the functions x80tod and dtox80 (see the header file fp.h) can be used to directly transform 680x0 80-bit extended data types to double and back.
StringToFormatRec, FormatRecToString, StringToExtended, and ExtendedToString return a result of type FormatStatus, which is an integer value. The low byte is of type FormatResultType. Typical examples of the returned format status are as follows:
Value |
Meaning |
fFormatOK |
The format of the input value is appropriate and the conversion was successful. |
fBestGuess |
The format of the input value is questionable. The result of the conversion may or may not be correct. |
fBadPartsTable |
The parts table is not valid. |

Main TextEdit Constants, Data Types and Functions
Constants
Alignment
teFlushDefault = 0
teCenter = 1
teFlushRight = -1
teFlushLeft = -2
Values for TESetStyle
doFont = 1
doFace = 2
doSize = 4
doColor = 8
doAll = 15
addSize = 16
Feature or Bit Definitions for TEFeatureFlag feature Parameter
teFAutoScroll = 0
teFTextBuffering = 1
teFOutlineHilite = 2
teFInlineInput = 3
teFUseWhiteBackground = 4
teFUseInlineInput = 5
teFInlineInputAutoScroll = 6
Data Types
typedef char Chars[32001];
typedef char *CharsPtr;
typedef CharsPtr *CharsHandle;
Edit Structure
struct TERec
{
Rect destRect; // Destination rectangle.
Rect viewRect; // View rectangle.
Rect selRect; // Selection rectangle.
short lineHeight; // Vert spacing of lines. -1 in multistyled edit structure.
short fontAscent; // Font ascent. -1 in multistyled edit structure.
Point selPoint; // Point selected with the mouse.
short selStart; // Start of selection range.
short selEnd; // End of selection range.
short active; // Set when structure is activated or deactivated.
WordBreakUPP wordBreak; // Word break function.
TEClickLoopUPP clickLoop; // Click loop function.
long clickTime; // (Used internally.)
short clickLoc; // (Used internally.)
long caretTime; // (Used internally.)
short caretState; // (Used internally.)
short just; // Text alignment.
short teLength; // Length of text.
Handle hText; // Handle to text to be edited.
long hDispatchRec; // Handle to TextEdit dispatch structure.
short clikStuff; // (Used internally)
short crOnly; // If <0, new line at Return only.
short txFont; // Text font. // If multistyled edit struct (txSize = -1),
StyleField txFace; // Chara style. // these bytes are used as a handle
SInt8 filler; // // to a style structure (TEStyleHandle).
short txMode; // Pen mode.
short txSize; // Font size. -1 in multistyled edit structure.
GrafPtr inPort; // Pointer to grafPort for this edit structure.
HighHookUPP highHook; // Used for text highlighting, caret appearance.
CaretHookUPP caretHook; // Used from assembly language.
short nLines; // Number of lines.
short lineStarts[16001]; // Positions of line starts.
};
typedef struct TERec TERec;
typedef TERec *TEPtr;
typedef TEPtr *TEHandle;
Style Structure
struct TEStyleRec
{
short nRuns; // Number of style runs.
short nStyles; // Size of style table.
STHandle styleTab; // Handle to style table.
LHHandle lhTab; // Handle to line-height table.
long teRefCon; // Reserved for application use.
NullStHandle nullStyle; // Handle to style set at null selection.
StyleRun runs[8001]; // ARRAY [0..8000] OF StyleRun.
};
typedef struct TEStyleRec TEStyleRec;
typedef TEStyleRec *TEStylePtr;
typedef TEStylePtr *TEStyleHandle;
Style Table Element
struct STElement
{
short stCount; // Number of runs in this style.
short stHeight; // Line height.
short stAscent; // Font ascent.
short stFont; // Font (family) number.
StyleField stFace; // Character Style.
short stSize; // Size in points.
RGBColor stColor; // absolute (RGB) color.
};
typedef struct STElement STElement;
typedef STElement TEStyleTable[1777];
typedef STElement *STPtr;
typedef STPtr *STHandle;
Line Height Table Element
struct LHElement
{
short lhHeight; // Maximum height in line.
short lhAscent; // Maximum ascent in line.
};
typedef struct LHElement LHElement;
typedef LHElement LHTable[8001];
typedef LHElement *LHPtr;
typedef LHPtr *LHHandle;
Style Run Table Element
struct StyleRun
{
short startChar; // Starting character position.
short styleIndex; // index in style table.
};
typedef struct StyleRun StyleRun;
Null Style Structure
struct NullStRec
{
long teReserved; // Reserved.
StScrpHandle nullScrap; // Handle to scrap style table.
};
typedef struct NullStRec NullStRec;
typedef NullStRec *NullStPtr;
typedef NullStPtr *NullStHandle;
Style Scrap Structure
struct StScrpRec
{
short scrpNStyles; // Number of styles in scrap.
ScrpSTTable scrpStyleTab; // Table of styles for scrap.
};
typedef struct StScrpRec StScrpRec;
typedef StScrpRec *StScrpPtr;
typedef StScrpPtr *StScrpHandle;
Scrap Style Table Element
struct ScrpSTElement
{
long scrpStartChar; // starting character position.
short scrpHeight; // Character height.
short scrpAscent; // Ascent above baseline this font.
short scrpFont; // Font (family) number.
StyleField scrpFace; // Character style.
short scrpSize; // Font size (points).
RGBColor scrpColor; // Colour used this style.
};
typedef struct ScrpSTElement ScrpSTElement;
typedef ScrpSTElement ScrpSTTable[1601]; // ARRAY [0..1600] OF ScrpSTElement.
Text Style Structure
struct TextStyle
{
short tsFont; // Font (family) number.
StyleField tsFace; // Character Style.
short tsSize; // Size in point.
RGBColor tsColor; // Absolute (RGB) color.
};
typedef struct TextStyle TextStyle;
typedef TextStyle *TextStylePtr;
typedef TextStylePtr *TextStyleHandle;
Functions
Initialising TextEdit, Creating Edit Structure, Disposing of Edit Structure
void TEInit(void);
TEHandle TENew(const Rect *destRect,const Rect *viewRect);
TEHandle TEStyleNew(const Rect *destRect,const Rect *viewRect);
void TEDispose(TEHandle hTE);
Activating and Deactivating an Edit Structure
void TEActivate(TEHandle hTE);
void TEDeactivate(TEHandle hTE);
Setting and Getting an Edit Structure's Text and Character Attribute Information
void TEKey(short key,TEHandle hTE);
void TESetText(const void *text,long length,TEHandle hTE);
CharsHandle TEGetText(TEHandle hTE);
void TESetStyleHandle(TEStyleHandle theHandle,TEHandle hTE);
TEStyleHandle TEGetStyleHandle(TEHandle hTE);
Setting the Caret and Selection Range
void TEIdle(TEHandle hTE);
void TEClick(Point pt,Boolean fExtend,TEHandle h);
void TESetSelect(long selStart,long selEnd,TEHandle hTE);
Displaying and Scrolling Text
void TESetAlignment(short just,TEHandle hTE);
void TEUpdate(const Rect *rUpdate,TEHandle hTE);
void TETextBox(const void *text,long length,const Rect *box,short just);
void TECalText(TEHandle hTE);
long TEGetHeight(long endLine,long startLine,TEHandle hTE);
void TEScroll(short dh,short dv,TEHandle hTE);
void TEPinScroll(short dh,short dv,TEHandle hTE);
void TEAutoView(Boolean fAuto,TEHandle hTE);
void TESelView(TEHandle hTE);
Modifying the Text of an Edit Structure
void TEDelete(TEHandle hTE);
void TEInsert(const void *text,long length,TEHandle hTE);
void TEStyleInsert(const void *text,long length,StScrpHandle hST,
void TECut(TEHandle hTE);
void TECopy(TEHandle hTE);
void TEPaste(TEHandle hTE);
void TEStylePaste(TEHandle hTE);
OSErr TEFromScrap(void);
OSErr TEToScrap(void);
Managing the TextEdit Private Scrap
#define TEScrapHandle(); (* (Handle*) 0xAB4);
#define TEGetScrapLength(); ((long) * (unsigned short *) 0x0AB0);
void TESetScrapLength(long length);;
Checking, Setting, and Replacing Styles
void TESetStyle(short mode,const TextStyle *newStyle,Boolean redraw,
TEHandle hTE);
void TEReplaceStyle(short mode,const TextStyle *oldStyle,
const TextStyle *newStyle,Boolean fRedraw,TEHandle hTE);
Boolean TEContinuousStyle(short *mode,TextStyle *aStyle,TEHandle hTE);
void TEStyleInsert(const void *text,long length,StScrpHandle hST,
TEHandle hTE);
TEStyleHandle TEGetStyleHandle(TEHandle hTE);
StScrpHandle TEGetStyleScrapHandle(TEHandle hTE);
void TEUseStyleScrap(long rangeStart,long rangeEnd,StScrpHandle newStyles,
Boolean fRredraw,TEHandle hTE);
long TENumStyles(long rangeStart,long rangeEnd,TEHandle hTE);
Using Byte Offsets and Corresponding Points
short TEGetOffset(Point pt,TEHandle hTE);
Point TEGetPoint(short offset,TEHandle hTE);
Customising TextEdit
void TESetClickLoop(TEClickLoopUPP clikProc,TEHandle hTE);;
void TESetWordBreak(WordBreakUPP wBrkProc,TEHandle hTE);;
void TECustomHook(TEIntHook which, UniversalProcPtr *addr,TEHandle hTE);
Additional TextEdit Features
short TEFeatureFlag(short feature,short action,TEHandle hTE);
Main Constants, Data Types and Functions Relating to Dates, Times and Numbers
Constants
StringToDate and StringToTime Status Values
fatalDateTime = 0x8000 Mask to a fatal error.
longDateFound = 1 Mask to long date found.
leftOverChars = 2 Mask to warn of left over characters.
sepNotIntlSep = 4 Mask to warn of non-standard separators.
fieldOrderNotIntl = 8 Mask to warn of non-standard field order.
extraneousStrings = 16 Mask to warn of unparsable strings in text.
tooManySeps = 32 Mask to warn of too many separators.
sepNotConsistent = 64 Mask to warn of inconsistent separators.
tokenErr = 0x8100 Mask for 'tokenizer err encountered'.
cantReadUtilities = 0x8200
dateTimeNotFound = 0x8400
dateTimeInvalid = 0x8800
FormatResultType Values for Numeric Conversion Functions
fFormatOK = 0
fBestGuess = 1
fOutOfSynch = 2
fSpuriousChars = 3
fMissingDelimiter = 4
fExtraDecimal = 5
fMissingLiteral = 6
fExtraExp = 7
fFormatOverflow = 8
fFormStrIsNAN = 9
fBadPartsTable = 10
fExtraPercent = 11
fExtraSeparator = 12
fEmptyFormatString = 13
Data Types
typedef short StringToDateStatus;
typedef SInt8 DateForm;
typedef short FormatStatus;
typedef Sint8 FormatResultType;
Data Cache Structure
struct DateCacheRecord
{
short hidden[256]; // Only for temporary use.
};
typedef struct DateCacheRecord DateCacheRecord;
typedef DateCacheRecord *DateCachePtr;
Number Format Specification Structure
struct NumFormatString
{
UInt8 fLength;
UInt8 fVersion;
char data[254]; // Private data.
};
typedef struct NumFormatString NumFormatString;
typedef NumFormatString NumFormatStringRec;
Functions
Getting Date-Time Values and Structures
void GetDateTime(unsigned long *secs);
void GetTime(DateTimeRec *d);
Converting Between Date-Time values and Structures
void DateToSeconds(const DateTimeRec *d,unsigned long *secs);
void SecondsToDate(unsigned long secs,DateTimeRec *d);
void LongDateToSeconds(const LongDateRec *lDate,LongDateTime *lSecs);
void LongSecondsToDate(LongDateTime *lSecs,LongDateRec *lDate);
Converting Date-Time Strings Into Internal Numeric Representation
OSErr InitDateCache(DateCachePtr theCache);
StringToDateStatus StringToDate(Ptr textPtr,long textLen,DateCachePtr theCache,
long *lengthUsed,LongDateRec *dateTime);
StringToDateStatus StringToTime(Ptr textPtr,long textLen,DateCachePtr theCache,
long *lengthUsed,LongDateRec *dateTime);
Converting Long Date and Time Values Into Strings
void DateString(long dateTime,DateForm longFlag,Str255 result);
void TimeString(long dateTime,Boolean wantSeconds,Str255 result);
void LongDateString(LongDateTime *dateTime,DateForm longFlag,Str255 result,
Handle intlHandle);
void LongTimeString(LongDateTime *dateTime,Boolean wantSeconds,Str255 result,
Handle intlHandle);
Converting Between Integers and Strings
void StringToNum(ConstStr255Param theString,long *theNum);
void NumToString(long theNum,Str255 theString);
Using Number Format Specification Strings For International Number Formatting
FormatStatus StringToFormatRec(ConstStr255Param inString,const NumberParts *partsTable,
NumFormatString *outString)
FormatStatus FormatRecToString(const NumFormatString *myCanonical,
const NumberParts *partsTable,Str255 outString,TripleInt positions)
Converting Between Strings and Floating Point Numbers
FormatStatus ExtendedToString(const extended80 x,const NumFormatString *myCanonical,
const NumberParts *partsTable,Str255 outString)
FormatStatus StringToExtended(ConstStr255Param source,
const NumFormatString *myCanonical,const NumberParts *partsTable,
extended80 *x)
Moving To and From Extended
void x80told(const extended80 *x80,long double *x);
void ldtox80(const long double *x,extended80 *x80);
double x80tod(const extended80 *x80);
void dtox80(const double *x, extended80 *x80);


|