Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change numerical text to real number in ProE 1

Status
Not open for further replies.

Oldbloke

Aerospace
Oct 28, 2004
3
We have a standard series of parts which use an alphanumeric string to identify them.

There are four characters within this string which are numeric, the first two denote the bore size in millimetres and the second two denote the length in millimetres.

We want to be able to pull apart the string that defines the part and have the program automatically size the part by reading the numeric text as numbers. (a reverse of itos really).
 
Replies continue below

Recommended for you

Thanks for your comment, I hadn't seen this before but we already use a function like the one shown.

What I really need is something that turns a string stating "123" into the number one hundred and twenty three.
As I said before it would be the opposite of itos which turns integers into text, I want to turn numerical text into integers.
 
I think you will have to decode the string and do the conversion manually.

get the string length
take each character and turn it into a numeric
multiple by the proper power to build the numeric value

123
decodes to 1 2 3 with a length of 3
1*100 + 2*10 + 3 = 123




"Wildfires are dangerous, hard to control, and economically catastrophic."

Ben Loosli
CAD/CAM System Analyst
Ingersoll-Rand
 
Thanks for your comment, it shortens the method I was thinking about.

It looks like it's going to be a long-winded method whichever way it's done.
It's a shame they can produce itos but not the reverse.
Oh well back to the slate and chalk!

Oldbloke
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor