Truncating or Rounding Parameters

Jul 20, 2007 3 Replies

I am having difficulties figuring out how to truncate a relation driven parameter in Wildfire 3.0. What I have is something like this:



(parameter) = (d1/d2)



Which is equal to a value, say 7.856522. I want this to be an INTEGER. Either 7 or 8. I can work with either truncation or rounding.



Any advise? I know it's probably simple, and I am just missing the boat.



I am having difficulties figuring out how to truncate a relation driven parameter in Wildfire 3.0. What I have is something like this:

(parameter) = (d1/d2)

Which is equal to a value, say 7.856522. I want this to be an INTEGER. Either 7 or 8. I can work with either truncation or rounding.

Any advise? I know it's probably simple, and I am just missing the boat.

I think you're looking for an expression like BIG=CEIL(d1/d2); or SMALL=FLOOR(d1/d2) which produces the largest or smallest integer which the expression can produce. This is neither strictly rounding nor truncating. CEIL(1.1) produces the integer 2; and FLOOR(1.9) produces the integer 1, so FLOOR is effectively truncating. CEIL, however, has no discretionary rounding capability. Pro/e's internal programming functionality, compared with SW's integration of VB, blows garbage scows. If you've got another $10-20K to blow on additional software, you can decadently indulge in (no, not in Godiva Chocolates, but) Pro/TOOLKIT, PTC's interface to the kernel functionality, thus the ability to write the code that makes up for PTC's lameness and laziness and cheapness and unresponsiveness and backwardness and carelessness and arrogance and .... (a hundred more such adjectives). For the best that Pro/e has to offer, check 'Help>Help Center>Fundementals' and search for relations or one of the above functions. And welcome to the group.

David Janes

messagenews: snipped-for-privacy@g4g2000hsf.googlegroups.com...

integer 2; and FLOOR(1.9) produces the integer 1, so FLOOR is effectively truncating. CEIL, however, has no discretionary rounding capability. Pro/e's internal programming functionality, compared with SW's integration of VB, blows garbage scows. If you've got another $10-20K to blow on additional software, you can decadently indulge in (no, not in Godiva Chocolates, but) Pro/TOOLKIT, PTC's interface to the kernel functionality, thus the ability to write the code that makes up for PTC's lameness and laziness and cheapness and unresponsiveness and backwardness and carelessness and arrogance and .... (a hundred more such adjectives). For the best that Pro/e has to offer, check 'Help>Help Center>Fundementals' and search for relations or one of the above functions. And welcome to the group.

Thank you Mr. Janes, that was exactly what I needed. I had seen the floor and Ceil commands, but my training didn't include those and my reference book doesn't mention them, so I had no idea I was staring at exactly what I needed. Worked perfect, again, thank you.

Thank you Mr. Janes, that was exactly what I needed. I had seen the floor and Ceil commands, but my training didn't include those and my reference book doesn't mention them, so I had no idea I was staring at exactly what I needed. Worked perfect, again, thank you.

FYI, another thing that approximates truncation (lopping off the decimal portion of a real number) is [.0]. Placing this as &parameter[.0] results in no decimals showing in the text, effectively truncating the real number to its lowest integer value. This doesn't actually change or round anything. This only effects the display of the number.

David Janes

P.S. Much more arcanery left to explore. But start with the Help menu. All the time, it is making me look smart.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required