Currency.FromText

From Xojo Documentation

Shared Method

Currency.FromText(theText As Text, Optional locale As Locale) As Currency

Converts a Text value containing a number that can be represented as a currency to a Currency value.

Notes

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

Sample Code

Convert values to the Currency type:

Dim userValue As Text
userValue = "123.45"

Dim c As Currency
c = Currency.FromText(userValue)

Dim locale As New Xojo.Core.Locale("en-US")
Dim value As Currency

userValue = "$123.45"
value = Currency.FromText(userValue, locale) ' value = 123.45

See Also

Currency.ToText