Double.ToText

From Xojo Documentation

Method

Double.ToText(Optional locale As Xojo.Core.Locale) As Double

Supported for all project types and targets.

Converts a Double value to a Text value with an optional locale.


Method

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

Supported for all project types and targets.

Converts a Double value to a Text value using the supplied locale and format.

Notes

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

Refer to Unicode Number Format Patterns for a list of formats.

Sample Code

Convert Double values to Text:

Dim d As Double = 123.45

Dim t As Text
t = d.ToText // t = "123.45"

Dim n As Double = 1239.4567
Dim t As Text = n.ToText(Locale.Current, "#,###.##") // t = 1,239.46

Dim n2 As Double = 12
Dim t2 As Text = n.ToText(Locale.Current, "#.00") // t2 = 12.00