Method

Currency.FromText


Warning

This item was deprecated in version 2024r1. Please use Currency.FromString as a replacement.

Description

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

This method is shared.

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

Convert values to the Currency type:

Var userValue As Text
userValue = "123.45"

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

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

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

Compatibility

All project types on all supported operating systems.