Number to String

Routine Summary

Converts a real number to a string.


N - the number you want to convert


Str1 - the number N in string form

Variables Used

L₁, L₂, Y₁, Str1, N

Calculator Compatibility



Note: If you have a TI-84+ CE with OS 5.2 or higher, you can ignore this entire routine and just use the toString( command.

:LinReg(ax+b) Y₁

This code works because it creates two points with a known best fit line: the best fit line through (0,0) and (1,N) is y=Nx+0. LinReg(ax+b) calculates this best fit line, and stores its equation to Y₁.

Then, we use Equ►String( to store this equation to Str1, which now contains "NX+0" with N replaced by the numerical value of N. After that, the sub( command get rids of the "X+0" at the end, leaving only the string representation of N.

This routine uses L₁, L₂, and Y₁, so you should clean up those variables at the end of your program. If you're working with the graph screen in function mode, storing to Y₁ can be a problem since it will draw an unwanted line through your graphics. Use r₁ instead but make sure the calculator isn't in polar mode.

Note: This only works for real numbers. With complex numbers, such as imaginary numbers, you can use this code at the end of the first to get the same effect with i in it.


Related Routines


Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License