Difference between revisions of "Converting Numbers to Text"
(Number to Text) |
|||
Line 1: | Line 1: | ||
[[Category:Styles and options]] | [[Category:Styles and options]] | ||
− | To convert a number to a text value, you can use [[Text Concatenation Operator: &|string concatenation]], e.g., <code>"" & x</code>. | + | To convert a number to a text value, you can use the [[NumberToText]] function or the [[Text Concatenation Operator: &|string concatenation]], e.g., <code>"" & x</code>. |
+ | |||
+ | To avoid confusion, using [[NumberToText]] is usually the better option. See [[NumberToText]] for information on that. The second method is described here. | ||
==Examples== | ==Examples== | ||
Line 9: | Line 11: | ||
:<code>"" & Exp(10) → '22.03K'</code> | :<code>"" & Exp(10) → '22.03K'</code> | ||
− | The coercion uses the number format for the object that contains the expression being evaluated. So, to use a different number format for the coercion, you must set the number format for that object. | + | The coercion uses the number format for the object that contains the expression being evaluated. So, to use a different number format for the coercion, you must set the number format for that object. When you set the number format while viewing a table for the variable, be sure that no cells are selected, because cell-level formats (formats that apply to only part of the table) do not influence the coercion to text. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== See Also == | == See Also == | ||
+ | * [[Text Concatenation Operator: &|string concatenation]] | ||
* [[Function_Parameter_Qualifiers#Coerce_.3Ctype.3E|Coerce function parameter qualifier]] | * [[Function_Parameter_Qualifiers#Coerce_.3Ctype.3E|Coerce function parameter qualifier]] | ||
* [[Numbers]] | * [[Numbers]] |
Revision as of 22:27, 19 March 2018
To convert a number to a text value, you can use the NumberToText function or the string concatenation, e.g., "" & x
.
To avoid confusion, using NumberToText is usually the better option. See NumberToText for information on that. The second method is described here.
Examples
"" & (2^10) → '1024'
"" & Pi → '3.142'
"" & Exp(10) → '22.03K'
The coercion uses the number format for the object that contains the expression being evaluated. So, to use a different number format for the coercion, you must set the number format for that object. When you set the number format while viewing a table for the variable, be sure that no cells are selected, because cell-level formats (formats that apply to only part of the table) do not influence the coercion to text.
See Also
Comments
Enable comment auto-refresher