System.Globalization.NumberStyles.AllowDecimalPoint Or System.Globalization.NumberStyles.AllowThousands
Module Example
Public Sub Main()
Dim value As String
Dim style As System.Globalization.NumberStyles
Dim culture As System.Globalization.CultureInfo
Dim number As Single
value = "1.234,567"
style = System.Globalization.NumberStyles.AllowDecimalPoint Or _
System.Globalization.NumberStyles.AllowThousands
culture = System.Globalization.CultureInfo.CreateSpecificCulture("es-ES")
If Single.TryParse(value, style, culture, number) Then
Console.WriteLine("Converted '{0}' to {1}.", value, number)
Else
Console.WriteLine("Unable to convert '{0}'.", value)
End If
End Sub
End Module
Related examples in the same category