writing a .csv file - independent of the culture
<p>In German langauage- decimal seperators are , and value seperators are ";" . In English/other languages, decimal seperators are . and values seperators are ",".</p>

<p>I want to create a .csv file indepedent of the current culture. I mean always the .csv file should have "." has decimal seperators and "," has value seperators. </p>

<p>The code for this given below.</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Globalization;

namespace CSV_FILE_FORMAT
{
    class Program
    {
        static void Main(string[] args)
        {
            string aFileName = "result.csv";
            FileStream aFileStream = new FileStream(aFileName, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None);
            StreamWriter m_StreamWriter = new StreamWriter(aFileStream);
            double[] values = new double[] { 10.5, 20.3, 30.2 };
            for(int i = 0; i &lt; values.Length;i++)
            {
                m_StreamWriter.Write(values[i].ToString(CultureInfo.InvariantCulture));
                m_StreamWriter.Write(",");
            }
        }
    }
}
</code></pre>

<p>The problem with this code is if OS is in German. The decimal seperators are shown "," instead of ".".</p>

<p>Please let me know the code is missing something.</p>
