cmdolcet
asked on
Format String
How can I format the CStr(_PositionReadingArray listValida ted(intInn erLoop)) and the CStr(_ReadingArrayList3(in tInnerLoop )) to 4 decimal places????
For intInnerLoop = 0 To _partfile.gageList.Count - 1
valuetemp1 = _PositionReadingArraylistValidated(intInnerLoop)
valuetemp2 = _ReadingsArraylistValidated(intInnerLoop)
valuetemp3 = valuetemp2 - valuetemp1
strText += CStr(_PositionReadingArraylistValidated(intInnerLoop)) & vbTab & valuetemp2 & vbTab & CStr(_ReadingArrayList3(intInnerLoop)) & vbTab & valuetemp3 & vbCrLf
Next
Another option is to use the Match.Round function on the numbers themselves.
ASKER
jp,when i change the code around i get an error: Value of type String cannot be converted to System.IformatProvider.
using: CStr(_ReadingArrayList3(in tInnerLoop )).ToStrin g("0.0000" )
using: CStr(_ReadingArrayList3(in
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can try
_ReadingsArraylistValidate
_PositionReadingArraylistV