Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: e32std.h
Link against: euser.lib

Class TRealFormat

TRealFormat

Support

Supported from 5.0

Description

Defines the character representation of a real number type such as a TReal or a TRealX.

An object of this type is used by functions which convert real values to character format; for example the descriptor functions: Num(), AppendNum() and Format().

There are three constructors for constructing a suitable object. The data members of the class, however, are public and can be explicitly set after construction.

Defined in TRealFormat:
TRealFormat(), iPlaces, iPoint, iTriLen, iTriad, iType, iWidth

See also:


Construction and destruction


TRealFormat()

TRealFormat();

Description

Default constructor.

The public data members of the constructed object are assigned the following values:

See also:


TRealFormat()

TRealFormat(TInt aWidth);

Description

Constructs the object taking the width of the character representation.

The remaining public data members of the constructed object are assigned the following values:

Parameters

TInt aWidth

The width of the character representation of the real number.

See also:


TRealFormat()

TRealFormat(TInt aWidth,TInt aDecimalPlaces);

Description

Constructs the object taking the width of the character representation and a value which is interpreted as the number of digits to follow the decimal point.

The remaining public data members of the constructed object are assigned the following values:

Note that if the iType data member is changed after construction, aDecimalPlaces may be interpreted as the number of significant digits. For more information see KRealFormatFixed and the other format types, and KExtraSpaceForSign and the other format flags.

Parameters

TInt aWidth

The width of the character representation of the real number.

TInt aDecimalPlaces

The number of digits to follow the decimal point.

See also:

[Top]


Public data members


iPlaces

TInt iPlaces

Description

Defines either the number of characters to be used to represent the decimal portion of the number, or the maximum number of significant digits in the character representation of the number.

The interpretation depends on the chosen format as defined by iType.


iPoint

TChar iPoint

Description

Defines the character to be used to separate the integer portion of a number representation from its decimal portion.

In general, the character used for this purpose is a matter of local convention. The TLocale::DecimalSeparator() function can supply the desired character.


iTriLen

TInt iTriLen

Description

Defines the threshold number of digits above which triad separation is to occur. A value of zero disables triad separation and no triad separation character (i.e. the character held in iTriad) is inserted into the resulting character representation regardless of the number of characters.

For example, a value of 1 causes the number 1000 to be represented by the characters “1,000” whereas a value of 4 causes the same number to represented by the characters “1000” (This assumes the ‘,’ triad separation character).

Note that no triad separation occurs if the flag KDoNotUseTriads is set in the iType data member.


iTriad

TChar iTriad

Description

Defines the character to be used to delimit groups of three digits in the integer part of the number.

In general, the character used for this purpose is a matter of local convention. The TLocale::ThousandsSeparator() function can supply the desired character.


iType

TInt iType

Description

Governs the format of the character representation of the real number.

This is set to one of the defined format types.

One or more of the defined format flags can subsequently be ORed into this member.


iWidth

TInt iWidth

Description

Defines the maximum number of characters required to represent the number.