Converting Numbers to Text

Revision as of 23:26, 18 July 2018 by Max (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

There are two ways to convert a number or date to a text value: One is to use the NumberToText function. It lets you specify the format explicitly as a parameter. See NumberToText for details. The other, described here, uses the Text Concatenation Operator: & to concatenate the number with a text --- e.g., "" & x.


"" & (2^10) → '1024'
"" & Pi → '3.142'
"" & Exp(10) → '22.03K'

Text concatenation automatically converts ("coerces) any number to text. It uses the Number format set for the variable whose definition contains the expression. So, the result may vary depending on the Number format specified. 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 you select the whole table, not just selected cells -- because cell-level formats don't affect the coercion to text.

See Also


You are not allowed to post comments.