|
Symbian sdk帮助-类Constants
译文作者:LeeFJ |
| 译文版本:1.0 译文时间:2005-11-14 |
|
|
Location: e32std.h
位于:e32std.h
Constants
Support
Supported from 5.0
支持5.0或5.0以上版本
Description
Constants which define the format of the character representation of a real number.
这些常量定义了实数以字符表达时的格式。
These values are set into the iType data member of TRealFormat.
这些值将被设置到TRealFormat对象的iType属性中。
--------------------------------------------------------------------------------
Format types
Description
These constants define the general format of the character representation of a real number. The iType data member of TRealFormat is set to one of these:
这些常量定义了实数在使用字符表达时较为普遍的格式。TRealFromat对象的iType属性,可能被赋以下值之一:
See also:
TRealFormat
--------------------------------------------------------------------------------
KRealFormatFixed
const TInt KRealFormatFixed
Description
The real number is converted to fixed format which has the general pattern: "nnn.ddd", where nnn is the integer portion and ddd is the decimal portion. A negative value is prefixed by a minus sign.
描 述
实数被转化为一种固定的格式,一种比较通俗的格式:"nnn.ddd",nnn是整数部分,ddd则是小数部分,如果是负数则需要在前面加一个减号。
The number of decimal places generated is defined by the value of TRealFormat::iPlaces.
格式化所产生的小数个数是由TRealFormat::iPlaces的值所决定的。
Trailing zeroes are generated as required. If necessary, the decimal portion is rounded to fit the specification. If this value is zero, no decimal point and no decimal portion is generated.
在必要情况下以0拖尾。如果有需要,小数部分将进行四舍五入以符合规格。如果只个值被指定为0,那么就没有小数点和小数部分产生。
Triad separation is available — defined by TRealFormat::iTriad and TRealFormat::iTriLen.
三位分隔符可用 - 由TRealFormat::iTriad和TRealFormat::iTriLen定义。
(N.B. a zero value is converted either to the form "0.000..." with iPlaces '0' characters after the decimal point, if iPlaces is greater than zero, or to "0" if iPlaces is zero.)
(注意,甚至是零也可以被转换为“0.0000...”这种形式,在小数点后跟随一系列的‘0’,只要iPlaces值大于零即可。当然如果iPlaces设置为0,那么就转换为“0”)
--------------------------------------------------------------------------------
KRealFormatExponent
const TInt KRealFormatExponent
Description
The real number is converted to scientific format with one non-zero digit before the decimal point and a number of digits after the decimal point. Hence the number has the general pattern: "n.dddE+ee" or "n.dddE-ee", or "n.dddE+eee" or "n.dddE-eee".
数字被转化为科学记数形式,在小数点前只有一个非零数字,小数点后则有多个数字。因此这种格式的数字通常有"n.dddE+ee"、"n.dddE-ee"、"n.dddE+eee"或是"n.dddE-eee"。
The decimal portion is followed by the character 'E', a sign ('+' or '-') and the exponent as two digits, including leading zeroes, if necessary. If necessary, the decimal portion is rounded.
小数部分的结束跟随了字符"E"、一个符号('+'或‘-’)以及可能以0开头的两位的指数。如果有必要的话,小数部分将被四舍五入。
A negative value is prefixed by a minus sign.
一个负数将以减号作为前缀。
If the flag KUseSigFigs is not set, TRealFormat::iPlaces defines the number of digits which follow the decimal point. If the flag KUseSigFigs is set, iPlaces defines the maximum number of significant digits to be generated.
如果没有设置 KUseSigFigs 标记,则TRealFormat::iPlaces定义了小数点后数字跟随的位数。如果设置了KUseSigFigs标记,则iPlaces定义的是将要被产生的有效数字的最大个数。
Note that, by default, exponents are limited to two digits. Those numbers that require three digits must have the flag KAllowThreeDigitExp set. If iPlaces is zero, the value is rounded to one digit of precision and no decimal point is included.
注意:在默认情况下,指数限制在两位。那些需要三位指数的数字必须使KAllowThreeDigitExp标记被设置。如果iPlaces 是0,那么数值被四舍五入成一位精度并且不会有小数点出现。
Triad separation is not available.
三位分隔符不可用。
(N.B. a zero value is converted either to the form "0.000...E+00" with iPlaces '0' characters after the decimal point, if iPlaces is greater than zero, or to "0E+00" if iPlaces is zero.)
注意:数值0被转换为"0.000...E+00"的科学计数形式时,如果iPlaces 大于0,那么在小数点后跟随若干‘0’字符;如果iPlaces等于0,那么就转化为"0E+00"的形式。
--------------------------------------------------------------------------------
KRealFormatGeneral
const TInt KRealFormatGeneral
Description
The real number is converted either to fixed or scientific format. The format chosen is the one which can present the greater number of significant digits. Where both formats can present the same number of significant digits, fixed format is used.
数值被转化为固定或科学计数的形式。具体选用何种格式表现则取决于究竟哪种格式能够保留更多的有效数字。当两种格式可以保留同样多的有效数字的时候,优先使用固定格式。
The number of decimal places generated depends only on the value of TRealFormat::iWidth; the value of the iPlaces member is ignored.
产生的小数部分的位数依赖于TRealFormat::iWidth的值,iPlaces将被忽略。
Trailing zeroes in the decimal portion are discarded.
在小数部分尾数加0将被废弃。
Triad separation is not available.
三位分隔符不可用。
(N.B. a zero value is converted to "0")
(注意:数值0将被转为“0”)
--------------------------------------------------------------------------------
KRealFormatNoExponent
const TInt KRealFormatNoExponent
Description
The same as KRealFormatFixed but the TRealFormat::iPlaces is interpreted as specifying the maximum number of significant digits.
描述
与KRealFormatFixed 类似,但是TRealFormat::iPlaces 被解释为有效数字的最大个数。
Trailing zeroes in the decimal portion are discarded.
在小数部分尾数加0将被废弃。
--------------------------------------------------------------------------------
KRealFormatCalculator
const TInt KRealFormatCalculator
Description
The same as KRealFormatGeneral but TRealFormat::iPlaces is interpreted as specifying the maximum number of significant digits, and the number is displayed without an exponent whenever possible.
描述
与KRealFormatGeneral 类似,但是TRealFormat::iPlaces 被解释为有效数字的最大个数。无论何时只要可以,数字将不以指数形式出现。
Trailing zeroes in the decimal portion are discarded.
在小数部分尾数加0将被废弃。
--------------------------------------------------------------------------------
Format flags
Description
These flags modify the format of the character representation of a real number as defined by the format types. One of more of these flags should be set into the iType data member of TRealFormat after setting one of the format types.
描述
格式化标记修改了由格式化类型所指定的实数的字符表现格式。在iType 数据成员设置了一个格式化类型以后,这些格式化标记也应该被设置到iType里面去。(译者:这种设置由或运算实现)
--------------------------------------------------------------------------------
KExtraSpaceForSign
const TInt KExtraSpaceForSign
Description
This flag reduces the effective width by one character. This forces a large enough value for TRealFormat::iWidth to be chosen to guarantee that positive and negative numbers can be shown to the same precision.
描述
这个标记减少一个字符的有效长度。这迫使选择一个足够大的TRealFormat::iWidth值以保证正数或者负数在显示时可以有同样的精度。
Applies when TRealFormat::iType is set to KRealFormatFixed or KRealFormatGeneral.
仅当iType属性被设置为 KRealFormatFixed 或 KRealFormatGeneral 时起作用。
--------------------------------------------------------------------------------
KAllowThreeDigitExp
const TInt KAllowThreeDigitExp
Description
Setting this flag allows an exponent to be formatted whose magnitude is greater than 100. If this flag is not set, an attempt to format such a number fails.
设置这个标记后,允许一个指数的值大于100,如果这个标记没有被设置,那么格式化将失败。
If set, three digit exponents are allowed. If not set, only two digit exponents are allowed.
如果设置,那么三位指数是允许的。如果没有设置,那么仅允许两位指数。
Applies when TRealFormat::iType is set to KRealFormatExponent or KRealFormatGeneral.
仅当iType属性被设置为 KRealFormatExponent 或 KRealFormatGeneral 时起作用。
--------------------------------------------------------------------------------
KDoNotUseTriads
const TInt KDoNotUseTriads
Description
Disables triad separation.
描述
禁用三位分隔符号。
Applies when TRealFormat::iType is set to KRealFormatFixed or KRealFormatNoExponent.
仅当iType属性被设置为 KRealFormatFixed 或 KRealFormatNoExponent时起作用。
--------------------------------------------------------------------------------
KGeneralLimit
const TInt KGeneralLimit
Description
If set, this flag limits the precision to 12 digits. If not set, the precision defaults to KMaxPrecision digits.
如果设置,则该标记限制精度在KPrecisionLimit位。如果不设置,那么精度就被默认设置为KMaxPrecision位。(译者:KPrecisionLimit和KMaxPrecision是在e32math.h中定义的TInt型常量)
--------------------------------------------------------------------------------
KUseSigFigs
const TInt KUseSigFigs
Description
If set, the TRealFormat::iPlaces member is interpreted as the maximum number of significant digits to be generated.
如果设置,则TRealFormat::iPlaces被解释为将要产生的有效数字的对多个数。
Applies when TRealFormat::iType is set to KRealFormatExponent.
仅当iType属性被设置为KRealFormatExponent 时起作用。 |