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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FormatNumber

Status
Not open for further replies.

ntolani

Programmer
Apr 25, 2002
13
US
After using the FormatNumber function, it seems as if some of my numbers are coming out okay, but others are being presented as "-1.#J". All the calculations are put through the same loop and all the number results are presented through the same loop....so it is a bit confusing why some work and others don't. Any help is much appreciated. Thank you.
 
The mean values come out okay. It's actually the corrected StDev and CV values that are having this issue. It's rather bizarre as only a few of the StDev's and CV's are presented as -1.#J and others are presented correctly. I've narrowed it down to it happening when the value is .00 (StDev) or 0.00 (CV)....but again, it only happens sometimes. I'm including some example results from the table as well as some code.

Meanraw StdDevraw %CVraw Meancor StdDevcor %CVcor
7254.09 1663.73 22.93 6949.62 1663.73 23.94
65535.00 .00 0.00 65230.53 .00 0.00
65535.00 .00 0.00 65230.53 -1.#J -1.#J
39559.40 10745.10 27.16 39254.93 10745.10 27.37
65535.00 .00 0.00 65184.82 -1.#J -1.#J
65535.00 .00 0.00 65184.82 .00 0.00

for ii=1 to nPooledSets(Ci)

// -- Mean of Median Corrected Values --
tmpString = tmpString & &quot;<td align='right'>&quot; & FormatNumber( _
PooledData(Ci,ii).MeanMediansCorrected,nDecimals,0,0,0) _
& &quot;</td>&quot;
// -- SD of Mean of Median Corrected Values --
tmpString = tmpString & &quot;<td align='right'>&quot; & FormatNumber( _
PooledData(Ci,ii).SDMediansCorrected,nDecimals,0,0,0) _
& &quot;</td>&quot;
// -- CV of Median Corrected Values --
If ( PooledData(Ci,ii).CVMediansCorrected = &quot;undef&quot; ) Then
tmpString = tmpString & &quot;<td align='right'>&quot; _
& PooledData(Ci,ii).CVMediansCorrected & &quot;</td>&quot;
Else
tmpString = tmpString & &quot;<td align='right'>&quot; & FormatNumber( _
100*PooledData(Ci,ii).CVMediansCorrected,nDecimals,-1,0,0) _
& &quot;</td>&quot;
End If
tmpString = tmpString & &quot;</tr>&quot;
Next

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top