I am trying to get the string output of a Double value with group separators and no loss in precision in any culture. Is there anyway to do this without writing my own method to do it?
I know you can use ToString("N0"), but this results in a loss of precision. I know you can use ToString("R") to keep the precision, but this doesn't include group separators.
E.g. For Double.MaxValue in Invariant Culture I would like
"179,769,313,486,231,570,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000"
Edit: When I say loss in precision I mean the full number of significant figures rather than not loosing precision in the 'decmial' part of the value. I want to be able to do 'round trips' with group separators, so ToString -> Parse -> ToString.
Edit 2: For a better comparison of the problem I'm trying to solve here is the output when using ToString("N0"). Here you can see the rounding at the end of the significant figures:
"179,769,313,486,232,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000"