From bc717471122014a06ac120ef97930453358b16c4 Mon Sep 17 00:00:00 2001 From: Joey Wunderlich Date: Mon, 8 Apr 2019 10:34:09 -0700 Subject: [PATCH] default to num instead of variable for toString (#1977) * default to num instead of variable for toString * to text instead of toString * converToText --- .../text/{to-string.md => convert-to-text.md} | 4 ++-- libs/core/control.ts | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) rename docs/reference/text/{to-string.md => convert-to-text.md} (57%) diff --git a/docs/reference/text/to-string.md b/docs/reference/text/convert-to-text.md similarity index 57% rename from docs/reference/text/to-string.md rename to docs/reference/text/convert-to-text.md index 5377b1a0..b95edccd 100644 --- a/docs/reference/text/to-string.md +++ b/docs/reference/text/convert-to-text.md @@ -1,7 +1,7 @@ -# to string +# convert to text Converts a value into a text representation. ```sig -toString(123) +convertToText(123) ``` \ No newline at end of file diff --git a/libs/core/control.ts b/libs/core/control.ts index a0403cb7..d8dcf036 100644 --- a/libs/core/control.ts +++ b/libs/core/control.ts @@ -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; } \ No newline at end of file