0

With Python, how can I select decimal separator for CSV files? In Python float, decimal separator is point, but for my case comma is needed.

According to Dialects and Formatting Parameters, there are no parameter in Dialect for this.

I think, problem may be solved with replacing point with comma like this:

str(my_float).replace('.',',')

But is seems a very ugly.

Thanks in advance.

codkelden
  • 332
  • 6
  • 9
  • Are your floating point numbers double quoted as required? **EDIT**: If they are, you should be able to retrieve each line and rely on [localization](https://docs.python.org/2/library/locale.html) to convert the numbers for you. –  May 02 '15 at 10:41
  • @Nasha, yes, it is: `"2015";"1";"39.68368";"0.0"` – codkelden May 02 '15 at 10:52

0 Answers0