<div class="meta" robots="noindex">

</div>

Method

# Single.ToText

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2020r2. Please use `Single.ToString<single.tostring>` as a replacement.

</div>

## Description

Converts a Single 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](http://unicode.org/reports/tr35/tr35-4.html#Number_Format_Patterns) for a list of formats.

## Sample code

Convert Single values to Text:

``` xojo
Var d As Single = 123.45

Var t1 As Text
t1 = d.ToText ' t = "123.45"

Var n1 As Single = 1239.4567
Var t2 As Text = n1.ToText(Xojo.Core.Locale.Current, "#,###.##") ' t2 = 1,239.46

Var n2 As Single = 12
Var t3 As Text = n2.ToText(Xojo.Core.Locale.Current, "#.00") ' t3 = 12.00
```

## Compatibility

All project types on all supported operating systems.
