I have a TI 84 Plus SE with the 2.43 OS. I was trying to do some specific output to the screen and realized it didn’t have the toString command which is in the newer OS. I don’t play around with the calculator that much to download the new OS. Just for kicks I wrote something that works. Since a lot of people here like to optimize code, I thought I would post it and see if anyone wants to optimize it or make it better. When the code is run, at the ? prompt, key in some value like .5 or √37 or sin(24). The result will be displayed on the same line as “Z=“ instead of the next line. It also prints out the full 14 digits of the answer if you display it on a line by itself. I just tried and realized that it doesn’t handle negative numbers. If a number is less than 1, it will print a leading 0 before the decimal point. The sub command can be use to limit the number of digits displayed.
Code:
Code:
Input V
“0123456789”->Str1
“0”->Str2
iPart(V)->I
fPart(v)->F
While I>0
fPart(I/10)->J
iPart(I/10)->I
sub(Str1,J*10+1,1)->Str3
If Str2=“0”
Then
Str3->Str2
Else
Str3+Str2->Str2
End
End
If F ≠ 0
Then
Str2+”.”->Str2
End
While F*10>0
iPart(F*10)->G
Str2+sub(Str1,G+1)->Str2
fPart(F*10)->F
End
Disp “Z=“+Str2