default to num instead of variable for toString (#1977)

* default to num instead of variable for toString

* to text instead of toString

* converToText
This commit is contained in:
Joey Wunderlich 2019-04-08 10:34:09 -07:00 committed by Abhijith Chatra
parent 405f4d94aa
commit bc71747112
2 changed files with 8 additions and 8 deletions

View File

@ -1,7 +1,7 @@
# to string
# convert to text
Converts a value into a text representation.
```sig
toString(123)
convertToText(123)
```

View File

@ -55,12 +55,12 @@ namespace control {
}
/**
* Convert any value to a string
* @param value value to be converted to a string
* Convert any value to text
* @param value value to be converted to text
*/
//% help=text/to-string weight=1
//% block="convert $value=variables_get(myValue) to string"
//% blockId=variable_to_string blockNamespace="text"
function toString(value: any): string {
//% help=text/convert-to-text weight=1
//% block="convert $value=math_number to text"
//% blockId=variable_to_text blockNamespace="text"
function convertToText(value: any): string {
return "" + value;
}