Skip to main content

Say I have 105.6546 and 5646.546356, how can I drop only the decimal and values to the right of the decimal? So my final values will be 105 and 5646.

The ExpressionEvaluator transformer can be used, using the floor function. It will be in the Math section.


The ExpressionEvaluator transformer can be used, using the floor function. It will be in the Math section.

Hi Erik_jan, it created a new field but all values were null.

 

 


Using the arithmetic editor in any of the transformers that create attributes, you can use @int() or @floor().

 

@int will truncate the value, @floor will return the next lowest integer, these are identical for positive values, but will differ by 1 for negative values.

 

@int(10.1) =>10

 

@floor(10.1) =>10

 

@int(-10.1) => -10

 

@floor(-10.1) => -11

The ExpressionEvaluator transformer can be used, using the floor function. It will be in the Math section.

You have to set the ExpressionEvaluator to overwrite existing attribue:

 

To get this result:

 

 


I would use the AttributeSplitter and use the first element of the lists.


For what it's worth, if the @floor function satisfies your requirement, the AttributeRounder (Decimal Places: 0, Round-off Direction: Down) can also be used. Instead of the @int function, the StringReplacer with this setting works for you.

  • Mode: Regular Expression Replace
  • Text to Replace: (.+)\\..*
  • Replacement Text: \\1

Reply