How to use round in Switch.Calculation

Post Reply
Danny
Member
Posts: 27
Joined: Wed Dec 08, 2010 5:59 pm

How to use round in Switch.Calculation

Post by Danny »

Hello,

I'm trying to use switch calculations in a flow. Specifically, I'm finding the total number of files in an ungrouped job and round up to the nearest 10. So if the folder had 22 files, I want the result to be 30.

I am not familiar with how to use rounding. I can't find any examples of it anywhere and the documentation doesn't explain much other than "round" is available.



Does anyone have any examples? Any help would be great.





Thank you



Danny
freddyp
Advanced member
Posts: 1023
Joined: Thu Feb 09, 2012 3:53 pm

How to use round in Switch.Calculation

Post by freddyp »

The round function rounds to the nearest integer. If you add 0.5 you are sure to round to the nearest higher integer, so the solution is:



[Switch.Calculation:Expression="round([Job.FileCount]/10+0.5)*10"]



Freddy
Danny
Member
Posts: 27
Joined: Wed Dec 08, 2010 5:59 pm

How to use round in Switch.Calculation

Post by Danny »

Thanks for your help Freddy, it's working exactly the way I was hoping it would.



Thanks again!



Danny
Post Reply