Printing double precision numbers

Hello All,
This should be really easy and I'm amazed that I have to send out this query.
I'm reading double precision numbers from a file, processing them and writing the results out in double precision. The precision is important because one column of this data is a time stamp.

The following code fragment reads in the time stamp and amplitude and prints it correctly on the console:
For clarity the input and output files have already been opened.
while (meof(inpf) == 0)
inline = mgetl(inpf,1);
if (meof(inpf) == 0)
[numargs, time, ampl] = msscanf(inline,'%lg,%lg');
format('v',16);
disp(numargs,time,ampl);

So far so good. However, if I try to write this out using the similar
mfprintf(outf,'%g,%g\n',time, ampl);

then a number like - 0.019999972 turns into -0.0199999 in the file.
If I use the %lg option like I did with msscanf, I get a 'bad conversion' error.
Do I have to use the Write routines? They have a very un C like format structure and the file id units don't seem to work with mopen.

Thanks,
Steve

Taxonomy upgrade extras: