Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I prevent num from displaying in Scientific Notation

Status
Not open for further replies.

roswald

Programmer
Jul 6, 2002
152
US
I need to display a number without having it converted to scientific notation because of it's size. Can someone tell me how to do this?

Thanks,

B
 
roswald

Can you explain? TRANSFORM() perhaps?

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
What range of values are speaking of? Is it a stored or computed value? (What field type?) VFP only handles so many digits in it's floatingpoint calculations, and if you need more you'll need a third party library to handle the bigger numbers.

Rick
 
Roswald,

The chances are that this problem comes about because the field in which you are trying to display the number is not wide enough. If you can widen the field, it might work. Worth a try, at least.

Mike


Mike Lewis
Edinburgh, Scotland
 
mgagnon, rgbean,MikeLewis,
Thank you all for the input. Here is what I was doing wrong.
I would bring in a numeric field from a remote view and it would display just fine. The field was N(11,0) and the range was from 1 to 99,999,999,999.
I needed to convert to Char and pad to the left with '0' out to the 11th placeholder. Here was my formula...
RIGHT(REPLICATE('0',11)+ALLTRIM(STR(ndc_num)),11), which of course worked fine on numbers out to the 10th placeholder. What I was missing was in the STR() function where I needed to indicate the length and optionally the decimal places. Well I have been doing this program since 4am and I was getting kind of goofy. I'm sure you've been there.
Here is what the formula needed to look like...
RIGHT(REPLICATE('0',11)+ALLTRIM(STR(ndc_num,11,0)),11).
Live and learn, right?
I appreciate the three of you offering your assistance.

B
 
Hey Roswald,

FYI- this does the same thing and it is easier to type:

PADL(TRANSFORM(ndc_num),11,"0")

[smile]
Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top