pxt-calliope/docs/reference/text/convert-to-text.md
Galen Nickel 19641abe92 Update 'convertToText' ref page ()
* Update 'convertToText' ref page

* say any type
2019-04-11 15:24:07 -07:00

718 B

convert to text

Change the value of any type into a text string.

convertToText(123)

Parameters

  • value: a value of some type to convert to a string.

Returns

  • a 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.

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, parse float