PRB: Need Clause on Double Field to Enter Scientific NotationLast reviewed: August 25, 1995Article ID: Q135673 |
The information in this article applies to:
SYMPTOMSWhile Visual FoxPro supports the representation of very large or very small numbers through scientific notation, the letter E required by this format cannot be entered directly into a numeric field. The expected format consists of a decimal value resulting from exponential multiplication or division (the mantissa), the letter E, and the positive or negative value indicating the number of times to multiply the mantissa by ten (the ordinant).
CAUSEConsidering that the location of the E key is directly below the top row of numeric keys, the potential for entering an E accidentally is too great to permit entering the format into a numeric field by default. This is by design.
WORKAROUNDTo allow entry of numeric data in scientific notation, the format property must be set to "^". When using a grid control set to populate automatically (ColumnCount set to -1), you must determine the appropriate column. For example, if a table field defined as double with three decimal places is the third field in the table, the following code in the Init event procedure of the form will display and accept scientific notation:
THISFORM.Grid1.Column3.Text1.Format="^" STATUSThis behavior is by design.
MORE INFORMATIONAlthough a mantissa value may be entered having both integer and decimal components, the result will be reduced to a decimal value only and the exponent portion recalculated. This conforms to IEEE specifications. The actual numeric value is unaffected, remaining the same regardless of the display format.
|
Additional reference words: 3.00 VFoxWin overflow asterisk circumflex
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |