Sorting files by trimbox size -Rounding

Post Reply
PatBuckley
Newbie
Posts: 8
Joined: Tue Aug 20, 2013 11:52 am

Sorting files by trimbox size -Rounding

Post by PatBuckley »

Hi,



I am using Switch to sort files based on trimbox width and height. Some files are not exactly the correct size by less than 0.1 mm but I want to allow these small inaccuracies through. Is there a rounding function?

I am currently using:

[Switch.Calculation:Expression="[Stats.TrimBoxWidth]*0.352777778",Precision="1"]



Regards



Pat Buckley
freddyp
Advanced member
Posts: 413
Joined: Thu Feb 09, 2012 3:53 pm

Sorting files by trimbox size -Rounding

Post by freddyp »

Yes, there is a round function in Switch-Calculation. When you select Switch-Calculation there is a description field in the variables pane with the following text:



Arithmetic expression to be calculated. Arithmetic operations, parentheses, numbers and function 'round' are allowed in 'Expression' argument



Freddy
PatBuckley
Newbie
Posts: 8
Joined: Tue Aug 20, 2013 11:52 am

Sorting files by trimbox size -Rounding

Post by PatBuckley »

Hi Freddie,



Yes I saw that but not sure how to implement it. Can you give me some guidance as to what the line of code should look like?



Regards



Pat B




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

Sorting files by trimbox size -Rounding

Post by freddyp »

round([Stats.TrimBoxWidth]*0.352777778)



when you are entering the calculated function. The complete variable will look like this"



[Switch.Calculation:Expression="round([Stats.TrimBoxWidth]*0.352777778)",Precision="1"]



Freddy
PatBuckley
Newbie
Posts: 8
Joined: Tue Aug 20, 2013 11:52 am

Sorting files by trimbox size -Rounding

Post by PatBuckley »

Thanks Freddy that is perfect. I was a bit concerned that I couldn't tighten the accuracy at first but I found that moving the decimal place on the multiplyer (*0.352777778) to (*3.52777778) and also moving the decimal place on the expected value (size) so the accuracy would fault the job out if it was 0.05mm out as opposed to a generous 0.5mm out.



Thanks again.



Regards



Pat Buckley
Post Reply