Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
Loading...
Searching...
No Matches
TRealFormat Class Reference

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

#include <e32std.h>

Public Member Functions

IMPORT_C TRealFormat ()
 Default constructor.
 
IMPORT_C TRealFormat (TInt aWidth)
 Constructs the object taking the width of the character representation.
 
IMPORT_C TRealFormat (TInt aWidth, TInt aDecimalPlaces)
 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.
 

Public Attributes

TInt iType
 Governs the format of the character representation of the real number.
 
TInt iWidth
 Defines the maximum number of characters required to represent the number.
 
TInt iPlaces
 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.
 
TChar iPoint
 Defines the character to be used to separate the integer portion of a number representation from its decimal portion.
 
TChar iTriad
 Defines the character to be used to delimit groups of three digits in the integer part of the number.
 
TInt iTriLen
 Defines the threshold number of digits above which triad separation is to occur.
 

Detailed 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 that 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.

API status
Published to all clients. Released API.

Definition at line 1050 of file e32std.h.

Constructor & Destructor Documentation

◆ TRealFormat() [1/3]

IMPORT_C TRealFormat::TRealFormat ( )

Default constructor.

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

TRealFormat::iType - set to KRealFormatGeneral

TRealFormat::iWidth - set to KDefaultRealWidth

TRealFormat::iPlaces - set to 0

TRealFormat::iPoint - set to the decimal separator character defined in a TLocale object and returned by the DecimalSeparator() member function of that class.

TRealFormat::iTriad - set to the character used to delimit groups of three digits in the integer portion of a number; the character is defined in a TLocale object and returned by the ThousandsSeparator() member function of that class.

TRealFormat::iTriLen - set to 1

TLocale::DecimalSeparator TLocale::ThousandsSeparator

(generated from Symbian Developer Library)

◆ TRealFormat() [2/3]

IMPORT_C TRealFormat::TRealFormat ( TInt  aWidth)

Constructs the object taking the width of the character representation.

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

TRealFormat::iType - set to KRealFormatGeneral

TRealFormat::iWidth - set to the aWidth argument

TRealFormat::iPlaces - set to 0

TRealFormat::iPoint - set to the decimal separator character defined in a TLocale object and returned by the DecimalSeparator() member function of that class.

TRealFormat::iTriad - set to the character used to delimit groups of three digits in the integer portion of a number; the character is defined in a TLocale object and returned by the ThousandsSeparator() member function of that class.

TRealFormat::iTriLen - set to 1

TLocale::DecimalSeparator TLocale::ThousandsSeparator

Parameters
aWidthThe width of the character representation of the real number.

(generated from Symbian Developer Library)

◆ TRealFormat() [3/3]

IMPORT_C TRealFormat::TRealFormat ( TInt  aWidth,
TInt  aDecimalPlaces 
)

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:

TRealFormat::iType - set to KRealFormatFixed

TRealFormat::iWidth - set to the aWidth argument

TRealFormat::iPlaces - set to the aDecimals argument

TRealFormat::iPoint - set to the decimal separator character defined in a TLocale object and returned by the DecimalSeparator() member function of that class.

TRealFormat::iTriad - set to the character used to delimit groups of three digits in the integer portion of a number; the character is defined in a TLocale object and returned by the ThousandsSeparator() member function of that class.

TRealFormat::iTriLen - set to 1

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.

TLocale::DecimalSeparator() TLocale::ThousandsSeparator() KRealFormatFixed KExtraSpaceForSign

Parameters
aWidthThe width of the character representation of the real number.
aDecimalPlacesThe number of digits to follow the decimal point.

(generated from Symbian Developer Library)

Member Data Documentation

◆ iPlaces

TInt TRealFormat::iPlaces

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.

See also
TRealFormat::iType

Definition at line 1093 of file e32std.h.

◆ iPoint

TChar TRealFormat::iPoint

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.

See also
TLocale

Definition at line 1106 of file e32std.h.

◆ iTriad

TChar TRealFormat::iTriad

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.

See also
TLocale

Definition at line 1119 of file e32std.h.

◆ iTriLen

TInt TRealFormat::iTriLen

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 be 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.

See also
TRealFormat::iTriad
KDoNotUseTriads

Definition at line 1139 of file e32std.h.

◆ iType

TInt TRealFormat::iType

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.

See also
KRealFormatFixed
KRealFormatExponent
KRealFormatGeneral
KRealFormatNoExponent
KRealFormatCalculator
KExtraSpaceForSign
KAllowThreeDigitExp
KDoNotUseTriads
KGeneralLimit
KUseSigFigs

Definition at line 1075 of file e32std.h.

◆ iWidth

TInt TRealFormat::iWidth

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

Definition at line 1081 of file e32std.h.


The documentation for this class was generated from the following files: