Please, I need to know how to make round up math calculations.
I need divide number for 4 and I need Integer number for result, round up it if necessary.
Example: 30/4 = 7,5 (but for number of copies It must be = 8)
Switch.Calculcation
Re: Switch.Calculcation
See here: http://www.enfocus.com/manuals/Develope ... _math.html for writing scripts
Free Switch scripts: open-automation @ GitHub
Free Switch apps: open-automation @ Enfocus appstore
Want to hire me? I'm looking for my next gig. Contact me on LinkedIn or via email.
Free Switch apps: open-automation @ Enfocus appstore
Want to hire me? I'm looking for my next gig. Contact me on LinkedIn or via email.
Re: Switch.Calculcation
Math.ceil will do;
Code: Select all
quantity = Math.ceil((origQuantity+extra)/nUp);
Re: Switch.Calculcation
I my case I had to divide number of pages by 2, but also needed the number to be rounded up if the number of pages was odd. I used the following:
Code: Select all
[Switch.Calculation:Expression="round([Stats.NumberOfPages]/2)"]