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

Losing digit when converting string to double if = 00

Status
Not open for further replies.

dcdogxx

IS-IT--Management
Feb 14, 2002
17
US

strnumbercaptured = CDbl(strCapturedString)

Need to force strnumbercaptured to 00 instead of 0 if strCapturedString is " 00". After this line is executed, strnumbercaptured is 0 instead of 00. How can I keep it 00?

This is for an application that reads in weights from the COMM port. This is for a scale. We are trying to get certified and the Certification person wants us to show 00 instead of 0 and I do not know how to do it.

Thanks in advance,

Darryl
 
You could use the Format function to force your expression into a certain format (i.e. Format("0","00") returns "00").

--
Jonathan
 
Thanks. I was trying that prior to my post but could not figure it out so I did not think that was right. I got it working.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top