Page 1 of 1

How to use round in Switch.Calculation

Posted: Thu Mar 27, 2014 10:29 pm
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

How to use round in Switch.Calculation

Posted: Fri Mar 28, 2014 5:45 pm
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

How to use round in Switch.Calculation

Posted: Fri Mar 28, 2014 10:59 pm
by Danny
Thanks for your help Freddy, it's working exactly the way I was hoping it would.



Thanks again!



Danny