4.711 can easily be converted to the fraction 4711/1000.
But I'm also not sure I see the point. If Johan justs want to output the same numbers without any changes, why not just keep them around as strings?
/ Niels Möller (vässar rödpennan)
Previous text:
2004-02-07 15:18: Subject: sscanf and Gmp.mpq
But you said "numbers (possibly with decimals)", which suggest that you are not, in fact, dealing with rational numbers.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)