Method

Currency.ToText


Warning

This item was deprecated in version 2020r2. Please use Currency.ToString as a replacement.

Description

Converts a currency value to a Text value using the specified locale.

Notes

To display the currency symbol, you need to pass in a locale. The currency symbol is displayed before or after the number as specified by the locale settings.

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

Sample code

Convert Currency to Text:

Var c As Currency = 123.45

Var t As Text
t = c.ToText ' t = "123.45"

In order to display the currency symbol you need to provide a locale:

Var c As Currency = 123.45

Var t As Text
Var locale As New Xojo.Core.Locale("en-US")
t = c.ToText(locale) ' t = $123.45

This code displays a value using French Canadian locale with the currency symbol after the number:

Var c As Currency = 123.45

Var t As Text
Var locale As New Xojo.Core.Locale("fr-CA")
t = c.ToText(locale) ' t = 123,45 $

Compatibility

All project types on all supported operating systems.

See also

Currency parent class; Currency.FromText