**1**

Looking for a string to float converter I came across this old thread, and have managed to include the `-' sign, as Harrison asked for.

The old thread was marked as `solved' so I opened a new thread to post my findings. Hopes it can help someone: -

Code:Dim sTemp As String * 15 ' Variable used to hold temporary strings sTemp = "-1.567" ' An example for a negative string number Sign = 0 ' Clear Sign fTemp = 0 ' Clear fTemp bTemp = Len(sTemp) -1 ' Take length of string fMultiplier = 1 ' Load fMultiplier with 1 For bTemp = bTemp To 0 Step -1 ' Create a loop length as sTemp bUnit = LookDownL sTemp[bTemp] , ["0123456789.-"] ' Load bUnit according to match If bUnit = 11 Then ' If bUnit = 11, (-) then Sign = 1 ' load Sign with 1 to indicate neg. value Continue ' jump to Next, skip the following EndIf ' End If...Then instruction If bUnit < 10 Then ' If bUnit is smaller or equal 9 then fTemp = fTemp + (bUnit * fMultiplier) ' add fTemp to bUnit and multiply it fMultiplier = fMultiplier * 10 ' increase multiplier Else ' else if bUnit is greater 9 then fTemp = fTemp / fMultiplier ' divide fTemp by fMultiplier fMultiplier = 1 ' reload fMultiplier with 1 End If ' End If...Then instruction Next ' Next loop If Sign = 1 Then fTemp = -fTemp ' Convert to negative if required