TI-BASIC:toString
From Learn @ Cemetech
Revision as of 00:56, 27 November 2017 by Battlesquid (talk | contribs)
Command Summary
Returns the string representation of the value of the input.
Command Syntax
toString(value)
Menu Location
This command is found only in the Catalog. Press:
- 2ND CATALOG to enter the catalog
- T to go to commands starting with T
- Scroll down to toString(
TI-84+ CE OS 5.2
2 bytes
The toString( command, given any value including real numbers, complex numbers, lists, or matrices, returns the string representation of the value of the input.
:toString(1337 //returns "1337"
:toString({1,2,3} //returns "{1,2,3}"
:toString([[1,2][3,4]] //returns "[[1,2][3,4]]"
:toString(√-1 //returns imaginary number "i"
toString( has less limitations than the eval( command. It can handle lists, matrices, and complex numbers. Another difference from eval( is that toString( is affected by display mode changes like Fix.
toString( replaces the old number-to-string routine previously used prior to OS 5.2.
Error Conditions
- ERR:DATA TYPE is thrown when the input is a string.
- ERR:NONREAL ANSWERS is thrown when the input is a complex number and your calculator is in REAL mode.
- ERR:SYNTAX is thrown when trying to evaluate a command that doesn't return a value.