Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
335
Wrong cell.value with complex formula
posted

Hello,

i have an issue with the Infragistics3.Excel.v10.3 (2128 atm) engine. A Customer is using our implementation to import a Excel 2007 file, with a formula =IF(A2>0;A2;B2-(B2*C2/100)) to calculate a price. But in the cell.value the calculated result from A2=nothing, B2=12,97, C2=31,0 is something like -2.714 if i transfer the calculation to another cell, so that the formula is =IF(A2>0;A2;D2) and D2=B2-(B2*C2/100) it calculates the correct value of 8,9493.

So is there an issue with the engine or am i doing something wrong?

Parents
No Data
Reply
  • 44743
    posted

    I cannot reproduce the issue with build 2128. Here is the code I used:

    CultureInfo cultureInfo = (CultureInfo)CultureInfo.CurrentCulture.Clone();
    cultureInfo.NumberFormat.NumberDecimalSeparator = ",";
    Thread.CurrentThread.CurrentCulture = cultureInfo;

    Workbook workbook = new Workbook();
    Worksheet worksheet = workbook.Worksheets.Add("Sheet1");
    worksheet.GetCell("B2").Value = 12.97;
    worksheet.GetCell("C2").Value = 31;
    WorksheetCell cell = worksheet.GetCell("A1");
    cell.ApplyFormula("=IF(A2>0;A2;B2-(B2*C2/100))");
    Console.WriteLine(cell.Value);
    Console.Read();

    The result is see if 8,9493. Can you provide a small sample which reproduces the issue?

Children