1234. <# #S #> TYPE (displays 1234)
Here, #S performs the same division technique as # , looping until the value on the stack is 0. It is possible to partially convert a number yourself manually, and then pass the remaining digits to #S to perform the rest of the conversion for you. This is particularly useful if you don't know the length of the number. For example:
123456. <# # # #S #> TYPE (displays 123456)
Here, the end result is the same: The example simply displays 123456, however, the first two digits (6 and 5) were converted manually, and the remaining digits (4321) were converted by #S and added to the PNO buffer automatically.
The following example formats a number by separating 100's from 1000's using a comma (see HOLD for more information on inserting characters into the PNO output):
123456. <# # # # ASCII , HOLD #S #> TYPE (displays 123,456)
Here, we manually processed the first three digits, then we manually inserted a comma character into the PNO stream using HOLD (see section 9.5). Finally, we let #S convert the rest of the number for us.
|