Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FLOOR() expects wrong number of args #347

Closed
1 of 3 tasks
andsnpl opened this issue Jun 13, 2017 · 2 comments
Closed
1 of 3 tasks

FLOOR() expects wrong number of args #347

andsnpl opened this issue Jun 13, 2017 · 2 comments
Labels
Milestone

Comments

@andsnpl
Copy link

andsnpl commented Jun 13, 2017

Do you want to request a feature or report a bug?

  • Bug
  • Feature

What is the current behavior?

FLOOR(1.5, 1) =>

System.Exception: Too many parameters.
   at ClosedXML.Excel.CalcEngine.CalcEngine.ParseAtom() in C:\\Projects\\ClosedXML\\ClosedXML\\Excel\\CalcEngine\\CalcEngine.cs:line 359
   at ClosedXML.Excel.CalcEngine.CalcEngine.ParseUnary() in C:\\Projects\\ClosedXML\\ClosedXML\\Excel\\CalcEngine\\CalcEngine.cs:line 332
   at ClosedXML.Excel.CalcEngine.CalcEngine.ParsePower() in C:\\Projects\\ClosedXML\\ClosedXML\\Excel\\CalcEngine\\CalcEngine.cs:line 313
   at ClosedXML.Excel.CalcEngine.CalcEngine.ParseMulDiv() in C:\\Projects\\ClosedXML\\ClosedXML\\Excel\\CalcEngine\\CalcEngine.cs:line 303
   at ClosedXML.Excel.CalcEngine.CalcEngine.ParseAddSub() in C:\\Projects\\ClosedXML\\ClosedXML\\Excel\\CalcEngine\\CalcEngine.cs:line 293
   at ClosedXML.Excel.CalcEngine.CalcEngine.ParseCompare() in C:\\Projects\\ClosedXML\\ClosedXML\\Excel\\CalcEngine\\CalcEngine.cs:line 283
   at ClosedXML.Excel.CalcEngine.CalcEngine.Parse(String expression) in C:\\Projects\\ClosedXML\\ClosedXML\\Excel\\CalcEngine\\CalcEn
gine.cs:line 81
   at ClosedXML.Excel.CalcEngine.ExpressionCache.get_Item(String expression) in C:\\Projects\\ClosedXML\\ClosedXML\\Excel\\CalcEngine\\ExpressionCache.cs:line 47
   at ClosedXML.Excel.CalcEngine.CalcEngine.Evaluate(String expression) in C:\\Projects\\ClosedXML\\ClosedXML\\Excel\\CalcEngine\\CalcEngine.cs:line 108
   at ClosedXML.Excel.XLWorksheet.Evaluate(String expression) in C:\\Projects\\ClosedXML\\ClosedXML\\Excel\\XLWorksheet.cs:line 1490
   at CXMLRepro.Program.Main(String[] args) in C:\\Users\\PAnderson\\Projects\\__scratch\\CXMLRepro\\Program.cs:line 13

If the current behavior is a bug, please provide the steps to reproduce and
if possible a minimal demo of the problem with a sample spreadsheet.

What is the expected behavior or new feature?

FLOOR(1.5, 1) => 1

Did this work in previous versions of our tool? Which versions?

Unknown

  • I attached a sample spreadsheet. (You can drag files on to this issue)

Code to reproduce problem:

public void Main()
{
    var wb = new XLWorkbook();
    var ws = wb.AddWorksheet("Sheet1");
    var formula = "FLOOR(1.5, 1)";
    var result = ws.Evaluate(formula);
    Console.WriteLine("Evaluated \"{0}\": {1}", formula, result); // will error. expected: 1

    Console.Write("Press any key to continue...");
    Console.ReadKey();
}
@igitur
Copy link
Member

igitur commented Jun 14, 2017

Have a stab at it and submit a PR.

@igitur igitur added this to the v0.89 milestone Jul 18, 2017
@igitur igitur added the bug label Jul 18, 2017
@igitur
Copy link
Member

igitur commented Aug 23, 2017

ClosedXML v0.89.0-beta1 has been published and is ready for your testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants