|
-
August 20th, 2001, 03:17 PM
#1
Number to string
Hi,
I would like to put 2.222545E-3 in string var.
I want "0.00222545" but I receive "2.222545E-3"
Somebody can help me?
Thanks
Redg
-
August 20th, 2001, 03:49 PM
#2
Re: Number to string
Dim dNum as Double
Dim sNum as string
sNum = "2.222545E-3"
dNum = sNum
sNum = dNum
MsgBox dNum
There should be a way to do this with the Format function but I could not get it to work with this sort of string constant. Here I just let VB do the conversion to a double and then back to a string to get the output that you requested.
-K
-
August 20th, 2001, 07:20 PM
#3
Re: Number to string
private Sub Command1_Click()
Dim sng as Single
sng = 0.00222545
MsgBox Format(sng, "0.####################")
End Sub
John G
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|