Integer.ToText

From Xojo Documentation

Method

Integer.ToText(Optional locale As Xojo.Core.Locale) As Text

Supported for all project types and targets.

Converts the Integer to a Text value using an optional locale.


Method

Integer.ToText(locale As Xojo.Core.Locale, format As Text) As Text

Supported for all project types and targets.

Converts the Integer to a Text value using the specified locale and format.

Notes

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

Refer to the Unicode Technical Standard #35, appendix G (Number Format Patterns) for information on how to specify a format.

Sample Code

Convert an Integer value to Text:

Var i As Integer = 42
Var t As Text = "The number is " + i.ToText

Add to an Integer directly and convert the new value:

Var n As Integer = 5
Var t As Text = Integer(n + 1).ToText // t = "6"

Formats the Integer value:

value = 1245
Var t As Text = value.ToText ' t = "1245"
t = value.ToText(Xojo.Core.Locale.Current, "#,###") // t = "1,245"