Quote Originally Posted by Dry Bone View Post
Regarding the original task which is

This may come as a stunning surprise, but the the VB's DIY function is about 6.5 times faster then atof in a compiled (and optimized) exe!
Code:
Function ArrToDouble(a() As Byte) As Double
Dim n As Double
Dim dec As Long
Dim mul As Long
Dim i As Long
Dim s As String
i = LBound(a)
Do While a(i)
    Select Case a(i)
    Case 46: If mul Then Exit Do Else mul = 1
    Case Is < 48: Exit Do
    Case Is > 57: Exit Do
    Case Else: n = n * 10 + a(i) - 48: If mul Then mul = mul * 10
    End Select
    i = i + 1
Loop
If mul Then ArrToDouble = n / mul Else ArrToDouble = n
End Function
Also, this function exits when a non-numeric character is encountered, so no need to replace commas with nulls.
When I get into my office, I'll benchmark it. That's interesting. I was thinking I might implement some "atoi" and "atol" today, but maybe that's going the wrong direction.