OleDB Read Excel decimal value

后端 未结 1 1226
广开言路
广开言路 2021-01-27 06:31

I am using OleDB Ace 12 to read an Excel (xslx) sheet containing a column with decimal values. When I open the Excel sheet on my PC a decimal value is correctly formatted as

相关标签:
1条回答
  • 2021-01-27 07:10

    I think you will get it US format only. You can convert it in code:

    string strFloatingNumber = "24.45"; //a floating point number in English notation
    double output = 0.0; //output double number which will hold the value
    double.TryParse(strFloatingNumber, out output); //convert without exception - assuming no error
    MessageBox.Show(output.ToString("N2", CultureInfo.CreateSpecificCulture("nl-NL")));
    
    0 讨论(0)
提交回复
热议问题