I want to round a double value to the nearest $100,000 (i.e. $3,456,789 = $3.500,000)
However this needs to be done as a string because it is a label for an open source Chart drawing tool that takes a string to create the labels.
Any suggestions?
Rounding Large Dollar amounts
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted Mar 1, 2012, 6:31 AM EST
string s = "$3,456,789";
string t = s.Substring(1).Replace(",", "");
double d = double.Parse(t);
d = Math.Round(d/100000) * 100000;
t = d.ToString("C0"); // $3,500,000
Thomas74 reputationPosted Mar 1, 2012, 7:00 AM EST
Thanks for the quick answer.