Converting Real Number to Integer
Hello,
I use Creo 2.0.
I have dome some internet research and I haven't been able to find how to convert a Real Number-type parameter (like 40.000) into an Integer-type (40) with relations. This is needed for downstream simulation purposes.
I tried the abs(), floor() and ceil() functions. They round to the correct value, but the type is still a real number.
I have tried this instruction as well: Creo String to Integer or Real Number Relation
So what I do is a double conversion: to first convert from Real to string using the itos() function, and then from string to Integer using the above... but what happens is that to output to an Integer, you must first manually create the output parameter before adding the relation (otherwise it defaults to real number), and only works on a known length string. I want to avoid that.
There must be some elegant solution around!
Any help would be appreciated.
Thanks, Alex
This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.

