I have a program the writes to a csv two columns. One is a ratio, of the form 1:100, or something similar, and the other is a score.
These values are stored in a Dictionary and printed as follows:
foreach (String s in p.normalizedScore.Keys)
{
sw.WriteLine(s + DELIM + p.normalizedScore[s]);
}
where sw is a StreamWriter and DELIM is a comma. The outputs is as follows:
1:10,7.498378506
0.111111111,18.46320676
0.736111111,30.08283816
1:10000 ,40.80688802
1:100000 ,51.93716854
1:1000000,62.89993635
1:10000000,73.54010349
The scores are all correct, but 2 of the ratios are printed incorrectly (it should be increasing 10 fold, so there should be a 1:100 and a 1:1000). When I enter the debugger, I find that at the time of printing, it’s still reading all the ratios correctly, meaning I can’t locate any place in my code where the ratios are wrong. Does anyone have an idea as to what the problem might be?
Edit: The above output was copied directly from Excel, but if I look at it in Notepad, the data seems fine, so it seems to me the problem is with Excel. (Still don’t know what it is mind you.)
As per the comments – this was an Excel formatting issue, not a code issue.
Adding Cory’s comment to the answer because I think it adds significant value: