2022-02-07 10:56 PM - last edited on 2022-09-30 02:57 PM by Oleksandra Vakariuk
I have also tried replacing STRCALCUNIT( ) with STR( Width / 1 in) to no avail.
Below is where I see the expression heading; I want to be able to show (2) 2x# when changing from Single to Double, 2 digits if stud Width is greater than 7", or 1 digit if stud width is Less than 7".
2022-02-08 12:06 AM
As you noted, this is not an issue of rounding since there is no way to "round" 11 1/4" to be 12". You are fighting with the north american nominal vs milled size of lumber which doesn't satisfy any mathematical formula. You can either do a table lookup process... or as you suggest in one of your screenshots, do a 'hack' that recognizes that you have to handle lengths greater than 8 by doing something weird like adding ½" and then rounding the result.
2022-02-08 01:51 AM
Simple rounding will round up or down as required.
However look at the available functions and you will see there are special round up/down functions as well as ones that can round to a multiple (i.e. in metric system timber is ordered in lengths of 300mm).
Barry.
2022-02-11 01:35 PM - edited 2022-02-11 01:37 PM
In metric, you could just add 0.5 to the value and get the Integer part of it with the ROUNDDOWN operator.
So if the value is between 0.00 to 0.4999999, you add 0.5, it will be between 0.50 to 0.9999999, and so its integer will be 0.
If the value is between 0.50 to 0.9999999, you add 0.5, it will be between 1.00 to 1.4999999, and so its integer will be 1.
I guess this could be applied to imperial as well.