Skip to main content
Question

Dividing using Expression Evaluator

  • July 1, 2015
  • 3 replies
  • 80 views

Forum|alt.badge.img+1
Hi,

 

 

I am using ExpressionEvaluator to do a simple division: AttributeX/AttributeY.  However, I keep getting 0 as the resultant value.

 

 

When I try ExpressionEvaluator to do 5/10 it also returns 0.  But when I test 10/2 it returns 5.  Therefore I am assuming it has something to do with floats.

 

 

What should I do to get this to work?

 

 

Thanks,
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

fmelizard
Safer
Forum|alt.badge.img+22
  • Safer
  • July 1, 2015
Hi,

 

The decimal trap no longer exists in FME 2015 so you are using an older version....see the following:https://knowledge.safe.com/communityanswers?id=906a0000000d7vTAAQ

 

Just add a decimal to one of the operands to resolve this, or upgrade to 2015

 

 

Forum|alt.badge.img+1
  • Author
  • July 1, 2015
Ah ok thanks Itay, I hadn't come across this decimal trap before.

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • July 3, 2015
it is ancient issue. It is not a trap at all. It is logic.

 

In older version you should always add a *1.0 to the dividor.