Microsoft KB Archive/126139

{| = PRB: STR Returns Scientific Notation =
 * width="100%"|

ID: Q126139

2.5x 2.60 2.60a | 2.5x 2.60 2.60a | 2.5x 2.60a | 2.60

WINDOWS        | MS-DOS          | MACINTOSH  | UNIX kbprg kbprb The information in this article applies to:


 * Microsoft FoxPro for Windows, versions 2.5, 2.5a, 2.5b, 2.6, 2.6a
 * Microsoft FoxPro for MS-DOS, versions 2.5, 2.5a, 2.5b, 2.6, 2.6a
 * Microsoft FoxPro for Macintosh, versions 2.5b, 2.5c, 2.6a
 * Microsoft FoxPro for UNIX, version 2.6

SYMPTOMS
The STR function returns a number in scientific notation.

CAUSE
The number passed to the STR function has more than 10 digits.

RESOLUTION
Use the optional second parameter for the STR function to specify the total number of digits to return. If this second parameter is not large enough, scientific notation will still be returned.

Steps to Reproduce Behavior
Type the following command in the Command window:

WAIT WINDOW STR(1234567890123) Note that the string returned in the wait window is: .1234E+13. To prevent FoxPro from returning scientific notation, specify the number of digits for the STR function to return, as in the following example:

WAIT WINDOW STR(1234567890123,13) For more information about changing the scientific notation used by FoxPro, please see the following article in the Microsoft Knowledge Base: ARTICLE-ID: Q148784 TITLE    : How to Use UDF to Modify Default Scientific Notation Format Additional reference words: FoxWin FoxDos FoxMac FoxUnix 2.50 2.50a 2.50b 2.50c 2.60 2.60a KBCategory: kbprg kbprb KBSubcategory: FxprgGeneral Keywords         : FxprgGeneral Version          : 2.5x 2.60 2.60a | 2.5x 2.60 2.60 Platform         : MACINTOSH MS-DOS UNIX WINDOWS
 * }