Single.Parse

From Xojo Documentation

Shared Method

Single.Parse(theString As String, Optional locale As Locale) As Single

Converts theString to a Single value.


Shared Method

Single.Parse(theText As Text, Optional locale As Xojo.Core.Locale) As Single

Converts theText to a Single value.

Notes

If no locale is specified, then Locale.Raw is used.

Numbers are converted only if they are found at the beginning of the text. Any numbers that follow a non-numeric value are ignored. Empty text returns 0.

Sample Code

Var d As Single
d = Single.Parse("123ABC")
// d = 123