Q:

How to stop Mathematica rounding the last digit of a number when converting it to string using ToString?

In Mathematica 8, numbers with no more than 16 significant digits are converted correctly, e.g.
ToString[
NumberForm[0.000001234567891234567, Infinity , 
ExponentFunction -> (Null &)]
]

gives "0.000001234567891234567". 
However numbers with more than 16 significant digits are rounded, e.g.
ToString[
 NumberForm[0.0000012345678912345678, Infinity , 
  ExponentFunction -> (Null &)]
 ]

gives "0.000001234567891234568". How can I avoid this behavior?

A:

You should explicitly specify the precision of your number using NumberMarks:
ToString[NumberForm[0.0000012345678912345678`17, Infinity, ExponentFunction -> (Null &)]]

"0.0000012345678912345678"

The reason of the problem is that your number is interpreted as a MachinePrecision number. If you simply add one zero to the end of this number the problem disappears because such (new!) number is interpreted as an arbitrary precision number:
0.00000123456789123456780 // InputForm

1.2345678912345678`17.091514977603566*^-6

0.00000123456789123456780 // MachineNumberQ

False

while your number is interpreted as a MachinePrecision number:
0.0000012345678912345678 // InputForm

1.2345678912345679*^-6

0.0000012345678912345678 // MachineNumberQ

True

