Update 'convertToText' ref page (#2002)

* Update 'convertToText' ref page

* say any type
This commit is contained in:
Galen Nickel 2019-04-11 15:24:07 -07:00 committed by Peli de Halleux
parent 18b672ae7a
commit 19641abe92
2 changed files with 47 additions and 2 deletions

18
docs/reference/text.md Normal file
View File

@ -0,0 +1,18 @@
# Text
Functions to combine, split, search, and convert text strings.
```cards
"".charAt(0);
"".compare("");
"".substr(0, 0);
parseFloat("");
parseInt("");
convertToText(0);
```
## See also
[char at](/reference/text/char-at), [compare](/reference/text/compare),
[substr](/reference/text/substr), [parse int](/reference/text/parse-int),
[parse float](/reference/text/parse-float), [convert to text](/reference/text/convert-text)

View File

@ -1,7 +1,34 @@
# convert to text
Converts a value into a text representation.
Change the value of any [type](/types) into a text [string](/types/string).
```sig
convertToText(123)
```
```
## Parameters
* **value**: a value of some [type](/types) to convert to a [string](/types/string).
## Returns
* a [string](/types/string) that is a text representation of **value**.
## Example #example
Convert a boolean and a number value into strings and join them in a sentence.
```blocks
let myBoolean = false
let myNumber = 0
myBoolean = true
myNumber = 123
let myString = "It is " + convertToText(myBoolean) + " that " + convertToText(myNumber) + " is now a string!"
```
## Sea also #seealso
[parse int](/reference/text/parse-int),
[parse float](/reference/text/parse-float)