CJ wrote:
This is a really silly question, but I just can't get it right.
I have a double; the value is 0.00003025. I want to display it exactly
as it stands, but by default it is displayed in scientific notation.
I've tried specifying the format as "G", "R", "F", whatever; none of
them gives me the result I want. The closest is "N", but then I have
to specify the number of digits/decimals that I want to display, and
this may vary - now the value is 0.00003025, next time it may be 0.02
and then I don't want it to display as 0.02000000!
The first thing you need to be aware of is that you *don't* have a
double with a value of 0.00003025. The closest you can have is a double
with a value of exactly
0.000030250000000000000060498481224691147417615866 28854274749755859375.
Now, given that information, how do you know what you need to display?
I *suspect* that the round-trip format specifier ("R") would be what
you wanted in terms of precision - but that the scientific notation
part is where you get message up.
I'll think about it further, but I hope the above helps a bit...
Jon