Skip to content

OptionForceIntegerNumbersEvaluationsAsDoubleByDefault leads to not recognising three parameter version of Math.Round #112

Open
@midgleyc

Description

@midgleyc

The code

var evaluator = new ExpressionEvaluator()
{
    OptionForceIntegerNumbersEvaluationsAsDoubleByDefault = true
};

string expression = "Math.Round(1,0,MidpointRounding.AwayFromZero)";

Console.WriteLine(expression);
Console.WriteLine(evaluator.Evaluate(expression));

gives the error

[System.Math] object has no Method named "Round".

instead of the expected result "1".

This came about in 1.4.31.0 and worked in 1.4.30.0 (but 1.4.31.0 is a good fix for #110, so thanks for that!)

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions