SHOW:
|
|
- or go back to the newest paste.
| 1 | :Input a,"Num to stringify" | |
| 2 | :0->b | |
| 3 | :while ipart(a) != 0 | |
| 4 | :then | |
| 5 | :a/10->a | |
| 6 | :b+1->b | |
| 7 | :end | |
| 8 | :" "->str1 | |
| 9 | :while a != 0 | |
| 10 | :then | |
| 11 | :if b = 0 | |
| 12 | :str1+"."->str1 | |
| 13 | :a*10->a | |
| 14 | - | :str1+sub("0123456789",ipart(a),1)->str1
|
| 14 | + | :str1+sub("0123456789",ipart(a)+1,1)->str1
|
| 15 | :fpart(a)->a | |
| 16 | :b-1->b | |
| 17 | :end | |
| 18 | :sub(str1,2,length(str1))->str1 | |
| 19 | :disp str1 |