Skip to main content
Solved

How to get/calculate reminder and rounding numbers?

  • September 27, 2018
  • 2 replies
  • 173 views

Hi, everyone, I'd like to do some math calculations in FME, just like Field Calculator in ArcGIS. I'm trying to calculate reminder and rounding numbers, but I'm not sure which math operator to use. Here're some examples:

Reminder: 5÷3, result:2; 10÷6, result:4

Rounding:5÷3, result:1; 10÷6, result:1

And I also want to add zeros before some results if their digits are less than 3.

I can get it done in ArcGIS by using python, reminder operator is %, rounding operator is //, and zfill function to fill zeros. How can get the same result in FME? I've read the Math Operators help document, it only has % as reminder, no rounding and zfill. I have over 600000 rows of record to calculate, when I do this in ArcGIS, the software will just crash. Please give me a hand.

Best answer by david_r

Remainder = @fmod(5,3) or 5 % 3

Rounding: @floor(@div(5,3))

Padding: StringFormatter transformer

View original
Did this help you find an answer to your question?

2 replies

david_r
Celebrity
  • Best Answer
  • September 27, 2018

Remainder = @fmod(5,3) or 5 % 3

Rounding: @floor(@div(5,3))

Padding: StringFormatter transformer


  • Author
  • September 28, 2018
david_r wrote:

Remainder = @fmod(5,3) or 5 % 3

Rounding: @floor(@div(5,3))

Padding: StringFormatter transformer

Thank you, got it worked!

 

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings