|
Symbian sdk帮助-类TRealFormat
译文作者:LeeFJ |
| 译文版本:1.0 译文时间:2005-11-14 |
|
|
Location: e32std.h
Link against: euser.lib
定义于:e32std.h
连接文件:euser.lib
Class TRealFormat
TRealFormat
Support
Supported from 5.0
支 持
支持5.0和5.0以上版本
Description
Defines the character representation of a real number type such as a TReal or a TRealX.
描述
定义了实数类型的字符表达方式。例如TReal和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().
这个类型的对象被作为函数的参数传递,这些函数可以把实数值转为字符格式。例如描述符函数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.
有三个构造函数可以用于构造合适的TRealFormat对象。这个类的数据成员被定义为public,在对象构建以后可以用显式的方法进行设置。
Members
Defined in TRealFormat:
TRealFormat(), TRealFormat(), TRealFormat(), iPlaces, iPoint, iTriLen, iTriad, iType, iWidth
成员
TRealFormat(), TRealFormat(), TRealFormat(), iPlaces, iPoint, iTriLen, iTriad, iType, iWidth
See also:
TDes8::Num()
TDes8::AppendNum()
TDes8::Format()
TDes16::Num()
TDes16::AppendNum()
TDes16::Format()
TReal
TRealX
另见
TDes8::Num()
TDes8::AppendNum()
TDes8::Format()
TDes16::Num()
TDes16::AppendNum()
TDes16::Format()
TReal
TRealX
-----------------------------------------------------------------------------
Construction and destruction
构造函数和析构函数
-----------------------------------------------------------------------------
TRealFormat()
TRealFormat();
Description
Default constructor.
描述
默认构造函数
The public data members of the constructed object are assigned the following values:
被构造的公共数据成员被赋以下值:
iType - set to KRealFormatGeneral
iType - 设置为 KRealFormatGeneral
iWidth - set to KDefaultRealWidth
iWidth - 设置为 KDefaultRealWidth
iPlaces - set to 0
iPlaces - 设置为 0
iPoint - set to the decimal separator character defined in a TLocale object and returned by the DecimalSeparator() member function of that class.
iPoint - 设置为在TLocale对象中定义的小数分隔字符,这个字符由该类的DecimalSeparator()成员函数返回。
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.
iTriad - 设置一个字符,把整数部分以三位分隔;这个字符被定义在TLocale对象中,并使用该类的ThousandsSeparator() 函数返回。
iTriLen - set to 1
iTriLen - 设置为1
See also:
TLocale::DecimalSeparator()
TLocale::ThousandsSeparator()
--------------------------------------------------------------------------------
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:
余下的公共数据成员被设置成以下值:
iType - set to KRealFormatGeneral
iType - 设置为:KRealFormatGeneral
iWidth - set to taken from the aWidth argument
iWidth - 设置为参数指定的宽度值。
iPlaces - set to 0
iPlaces - 设置为0
iPoint - set to the decimal separator character defined in a TLocale object and returned by the DecimalSeparator() member function of that class.
iPoint - 设置为在TLocale对象中定义的小数分隔字符,这个字符由该类的DecimalSeparator()成员函数返回。
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.
iTriad - 设置一个字符,把整数部分以三位分隔;这个字符被定义在TLocale对象中,并使用该类的ThousandsSeparator() 函数返回。
iTriLen - set to 1
iTriLen - 设置为1
Parameters
TInt aWidth The width of the character representation of the real number.
参数:
TInt aWidth 实数在字符表达时的宽度。
See also:
TLocale::DecimalSeparator()
TLocale::ThousandsSeparator()
--------------------------------------------------------------------------------
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:
余下的公共数据成员被设置成以下值:
iType - set to KRealFormatFixed
iType - 设置为 KRealFormatFixed
iWidth - set to taken from the aWidth argument
iWidth - 设置为aWidth参数指定的宽度值。
iPlaces - set to taken from the aDecimals argument
iPlaces - 设置为aDecimals 参数指定的值。
iPoint - set to the decimal separator character defined in a TLocale object and returned by the DecimalSeparator() member function of that class.
iPoint - 设置为在TLocale对象中定义的小数分隔字符,这个字符由该类的DecimalSeparator()成员函数返回。
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.
iTriad - 设置一个字符,把整数部分以三位分隔;这个字符被定义在TLocale对象中,并使用该类的ThousandsSeparator() 函数返回。
iTriLen - set to 1
iTriLen - 设置为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.
注意
如果iType属性在对象构造后被修改,那么aDecimalPlaces 可能被解释为有效数字的位数。更多的信息详见KRealFormatFixed和其它格式化类型、KExtraSpaceForSign 和其他格式化标记。
Parameters
TInt aWidth The width of the character representation of the real number.
TInt aDecimalPlaces The number of digits to follow the decimal point.
参数:
TInt aWidth 实数在字符表达时的宽度。
TInt aDecimalPlaces 小数点后跟随的数字个数。
See also:
TLocale::DecimalSeparator()
TLocale::ThousandsSeparator()
KRealFormatFixed
KExtraSpaceForSign
--------------------------------------------------------------------------------
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.
具体使用何种方式解释,则依赖于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.
通常,用于该目睹的这个字符有本地的习惯所决定。TLocale::DecimalSeparator()函数可以提供你需要的这个字符。
--------------------------------------------------------------------------------
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.
定义一个位数的最大值,当位数超过这个值时则需要使用三位分隔符。如果这个值设为零,则禁用了三位分隔符,分隔符(既在iTriad存储的那个字符)不会插入到结果描述符中
。
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).
例如,1000则可以使用这样的字符形式来表现:“1,000”(这个逗号就是三位分隔符)。
Note that no triad separation occurs if the flag KDoNotUseTriads is set in the iType data member.
注意:如果 KDoNotUseTriads 被设置到iType那么将不再出现这个三位分隔符。
--------------------------------------------------------------------------------
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.
通常,用于这个用途的字符与本地的习惯有关。TLocale::ThousandsSeparator() 方法可以帮助你得到一个合适的字符。
--------------------------------------------------------------------------------
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.
描述:定义了需要表现数字的最多字符个数。
|