c# - Write double value to cell independent of culture -
i set value of cell in spreadsheet using excel com interop:
public void setvalue(double value, string sheetname, int cellrow, int cellcolumn) { var cell = getcell(sheetname, cellrow, cellcolumn); cell.value2 = value; }
getcell()
method returning range object.
depending on system culture settings, method doesn't work properly:
these values:
are written follows, if culture of excel german:
my questions:
- why doesn't excel handle formatting properly? isn't
value2
"typesafe"? - how can set double value correctly independent of system culture?
Comments
Post a Comment