
01-15-2003, 02:43 PM
|
|
|
Question on Format the number
|
Hi friends,
I like to be more specific and format the float number like:
Number1e-4
.....1e-3
.....1e-2
How can I format it? please take a look at what I have done sofar.
Many thanks for your help,
Elahe
Code
=====
Public Function chooseFormat(dblValue As Double) As String
Dim StrRet As String
dblTest = Abs(dblValue)
'Negative Number
If condition Then
StrRet = Format(dblTest, "#.###e-###")
StrRet = "-" + StrRet
ElseIf dblValue > 0 Then
StrRet = Format(dblTest, "#.###e+###")
'ElseIf condition Then
'StrRet = Format(dblTest, "????")
End If
If dblValue < 0 Then
StrRet = Format(dblTest, "#.###e-###")
StrRet = "-" + StrRet
chooseFormat = StrRet
End If
End Function
|
|