I feel a bit dumb asking this... I need to format a number to show thousands separator, decimal mark, and exactly the precision that is needed to show all significan digits. I have a working solution, but feel there must be a better way:
double myNumber = 1234.56789;
myNumber.ToString("#,##0.#########################################################################################################################"); // see my problem with this?
// will yield "1,234.56789"
I googled both internets from start to end and couldn't find an answer to my problem. Answers on SO like remove trailing zeros and C# String.format a number with dynamic number of significant digits don't respect the thousands separator requirement. And both msdn articles for Standard Numeric Format Strings and Custom Numeric Format Strings have been read and re-read by me without bringing a breakthrough.
My attention was brought to c# how to String.Format decimal with unlimited decimal places? but unfortunately no answer came up with a more concise format string.
What format string would a sane and proficient developer use?