Can't find what you're looking for?

Contact us or post in our forums and we'll help you find an answer.

Make Decimal Point Formatting Consistent When Saving FlexGrid Data to a CSV File in Different Cultures

Background:

C1FlexGrid’s SaveGrid method changes the decimal separator according to region when saving grid data to a CSV file. For example. when saving grid data to a CSV file in ko culture, it looks like this:  3.2, 4.1, 33.2. While saving the same grid data to a CSV file in de culture, the file looks like this: "3,2","4,1","33,2".

To make the decimal point consistent across cultures, you must change the NumberDecimalSeparator of the NumberFormat in the current culture to a decimal point. This can be done with the following code:

CultureInfo.CurrentCulture = CultureInfo.CreateSpecificCulture(CultureInfo.CurrentCulture.Name);
CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator = ".";

Get the Latest Version of C1
Download the Free Trial Now