Integrating a Rounding Up Function into an Equation

Hello community.

 

As part of the creation of standard models on SW, I have a machining breakdown to do.

I found the mathematical function allowing me to distribute them, however it integrates a rounding up by one value.

Hors SW does not allow you to do this.

Do you have a solution??? Knowing that the natural number +1 does not work because in some because it will add one too many occurrences.

 

Thank you in advance

 

Happydad

Put "int" at the beginning of your formula.

 

Tell us if it works.

1 Like

No, it doesn't work, INT corresponds to the natural number. (so the rounded down) but in my case I need the rounding up.

 

For me, we need to add a level of condition. The easiest way is to add an equation using the result of your previous calculation. Example in Excel syntax :

OCCUR is the number of occurrences previously calculated without rounding

OCCUR_CORRIG being the final number you want

OCCUR_CORRIG = IF ( OCCUR - INT(OCCUR) = 0; OCCUR; OCCUR + 1 )

So if my number of occurrences minus its own integer is equal to zero, I use the number as it is (i.e. it is already integer. If not, I add 1.

Not sure if I'm clear! :)

1 Like

If it is to distribute the holes according to a maximum predefined center distance,

 

I use this formula:

 

number = ( "L" - 2 * "dep" ) / "ent max" + 1.5

centre distance = ( "L" - 2 * "dep" ) / ( "nb" - 1 )

 

1 Like

In driveworks, the round.SUp. function works.

1 Like

@Bart to my despair in driveworks and not SW. (our US friends didn't realize a lack??).

@Benoit. Not wrong internally, someone has just suggested it to me too. I wanted to avoid but I think I'm not going to have a choice. (it will make me nested IF functions and I'm not a fan)

I'll give you a better answer but if someone finds a simpler solution I'm interested

1 Like

To make configurable things, there's nothing like driveworks.

 

Easy to use, and more complete in equation. What's more, it's free! in xpress

1 Like