Skip to main content

alphaWorks  >  Forums  >  decNumber  >  developerWorks

decNumberToString/decToString and scientific notation    Point your RSS reader here for a feed of the latest messages in this thread


     

 
 

My developerWorks
 Welcome, Guest
Sign in or register
This question is not answered.

Permlink Replies: 0 - Pages: 1 Threads: [ Previous | Next ]
Jamesss

Posts: 3
Registered: Nov 17, 2008 05:13:37 PM
decNumberToString/decToString and scientific notation
Posted: Apr 29, 2009 08:33:44 PM
 
Click to report abuse...   Click to reply to this thread Reply
Hi,

I have a somewhat urgent question about the decNumberToString/decToString and when it switches from plain to scientific notation.

0.000001 will result in a plain "0.000001" but 0.0000001 will result in 1E-7
I need the switch to occur at precisions of 10 decimal places or so.

I looked at the source for decToString and it does seem to be decided by the hard coded value here...

if ((exp>0) || (pre<-5)) { // need exponential form

I appears that it would be ok to simply change the 5 to a larger value but I would like some confirmation that this won't introduce problems.

Can you help Mike?

thanks,

James

Point your RSS reader here for a feed of the latest messages in all forums