Talk:Data types/@comment-66.131.50.117-20150315135131/@comment-5334617-20150316165220

The way I would create a string for the exact decimal representation of the fractional part of a stored numerical value (F) is: create two numerical arrays with 12 entries (one for each digit). Start one (V) with the values 0,0,0,... and the other (A) with 10,0,0,0,.... While F is nonzero: - halve A - double F - if F>=1 then add A to V - get the fractional part of F. Then, starting at the right end of V, convert each array entry to a digit, skipping trailing zeros if you don't want them in your string, and taking care to handle carries.

If F is zero in the first place, skip the whole procedure, because you've got an integer.