0

I have a piece of code that read data from excel file store it in DB.

`decimal num = Convert.ToDecimal(rowOptions["excel_cl_name"]);`

But it does not work properly for NL culture. Let say when value is 878,90 it should be 878.9000 but it becomes 87890.0000. When value is 123,5 , it should be 123.5000 but it becomes 1235.0000. When value is 123 then it is 123.0000.

I cannot replace the ',' with space and divide the number by 100 as for other 2 cases it will fail.

Note: In database precision is 4.

Is there any way I can force the culture to be en-us always ? Is there a better way to manage it? I can also have value like 12.345,90 which is 12,345.9000.

user1926138
  • 1,464
  • 7
  • 34
  • 53

0 Answers0