Currency.FromString

From Xojo Documentation

Shared Method

Currency.FromText(value As String, Optional locale As Locale) As Currency

New in 2019r2

Converts a String 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:

Var userValue As String
userValue = "123.45"

Var c As Currency
c = Currency.FromString(userValue)

Var locale As New Locale("en-US")
Var value As Currency

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

See Also

Currency.ToString