Gjoreski
Administrator
Registrovan od:02.02.2009
Lokacija:Ohrid Makedonija
Predmet:
Izvlacejne Broj od stinga sa decimalom
Ako nekome zatreba :
Preuzmi
Izvorni kôd (Visual Basic):
Public
Function
Extract_Number_With_Decimal(Phrase
As
String
)
As
Double
Dim
Length_of_String
As
Integer
Dim
Current_Pos
As
Integer
Dim
Temp
As
String
Length_of_String = Len(Phrase)
Temp =
""
For
Current_Pos = 1
To
Length_of_String
If
(Mid(Phrase, Current_Pos, 1) =
"-"
)
Then
Temp = Temp & Mid(Phrase, Current_Pos, 1)
End
If
If
(Mid(Phrase, Current_Pos, 1) =
"."
)
Then
Temp = Temp & Mid(Phrase, Current_Pos, 1)
End
If
If
(IsNumeric(Mid(Phrase, Current_Pos, 1))) =
True
Then
Temp = Temp & Mid(Phrase, Current_Pos, 1)
End
If
Next
Current_Pos
If
Len(Temp) = 0
Then
Extract_Number_With_Decimal = 0
Else
Extract_Number_With_Decimal = CDbl(Temp)
End
If
End
Function
Ovaj post je ureden
2
puta. Posljednja izmjena 13.06.2018 08:51 od strane Avko.