This is a migrated thread and some comments may be shown as answers.

Problems with the Round function

6 Answers 71 Views
ExpressionEditor
This is a migrated thread and some comments may be shown as answers.
Sandy
Top achievements
Rank 1
Sandy asked on 31 Jan 2019, 01:15 PM
A company that I consult for has an application that uses the expression editor.  A configuration box that uses the expression editor has a calculation that used to work but no longer does.  It appears that the Round function has changed to not allow parenthesis within it's own.  Can someone explain if there has been a recent change in R1 2019 that might explain this?

6 Answers, 1 is accepted

Sort by
0
Jesse
Top achievements
Rank 1
answered on 04 Feb 2019, 09:41 PM

Other functions have this issue as well for example, the Abs function:

Works: Abs(1*2+2)

Doesn't work:  Abs(1*(2+2))

The expression editor flags this as an error.

This worked in an older version of the Telerik UI for WPF demo software. After downloading the latest version (R1 2019), it no longer works???

0
Ivan Petrov
Telerik team
answered on 05 Feb 2019, 01:16 PM
Hi Sandy and Jesse,

Thank you for bringing our attention to this issue.

We made some significant improvements to the expression parser engine in our last release (R1 2019) and it seems this case has been missed in our tests. I have logged a feedback item which you can track to get a notification when a fix will be available. Due to the implementation of the parser, I am not able to provide you with a workaround. I have prepared a fix candidate and will test it in the coming days. The fix should be available in the next internal build or the next service pack the latest. 

If you have further input into this issue, do not hesitate to write back.

Regards,
Ivan Petrov
Progress Telerik
Get quickly and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Sandy
Top achievements
Rank 1
answered on 05 Feb 2019, 03:44 PM
I believe the problem also exists in the IF() function too.  It seems as almost no functions allow parenthesis within parenthesis.  The statement IF((A<1) OR (A>5),1,0) used to work and now does not.  Fortunately I was able to remove the inner parenthesis and have it work, although it is more difficult to read.
0
Ivan Petrov
Telerik team
answered on 05 Feb 2019, 04:05 PM
Hi Sandy,

Thank you for adding to the case.

Indeed, the problem is with parentheses inside of a method's arguments. I am adding this case to the list of scenarios I will test the fix candidate against. 

Your help in this is really appreciated so anything else that comes up, do not hesitate to throw my way.

Regards,
Ivan Petrov
Progress Telerik
Get quickly and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Jesse
Top achievements
Rank 1
answered on 05 Feb 2019, 08:11 PM

Hi Ivan,

There also appears to be an issue with the way the "IF" function is added to the editor's text box when the function name is double-clicked. If you click on the IF function, the description below shows "Condition" instead of "IF" and if you double-click to add the function to add it to the expression the function that gets added is "Condition", which is invalid. The function should be IF, which works. Please see the attached screenshot from the R1 2019 WPF demo.

0
Ivan Petrov
Telerik team
answered on 06 Feb 2019, 09:37 AM
Hello Jesse,

Thank you for your input into this thread.

I was able to reproduce the behaviour you have described and found the cause of it. We mask the .Condition with the IF operator so it would be easier for end users to recognize its intended use. In the case of the double click we use the actual function name instead of the alias. I have submitted a fix for our QAs to test and it should make its way into our next internal build.

I have also updated both yours and Sandy's Telerik Points for your feedback and help.

As before if anything comes up, let us know.

Regards,
Ivan Petrov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
ExpressionEditor
Asked by
Sandy
Top achievements
Rank 1
Answers by
Jesse
Top achievements
Rank 1
Ivan Petrov
Telerik team
Sandy
Top achievements
Rank 1
Share this question
or