0
Answered

How To Select A Number From A Number

Carl 3 years ago in IQANdesign updated by Ulrik Zakariasson (Software development) 3 years ago 2

Hi Guys,


A simple one for you.

I have a number, say 0123456. I want to be able to select one of the numbers from this number, so say 5 from the left. (4) then in another part, the 2 from the left (1) how do I do it?



Cheers,



Carl

Of the top of my head, If this is a decimal number; selection from the >right< would be achieved by:

The 1st: ((0123456 div    1) mod 10) = 6

The 2nd: ((0123456 div   10) mod 10) = 5

The 3rd: ((0123456 div  100) mod 10) = 4

The 4th: ((0123456 div 1000) mod 10) = 3

etc..

Be sure to use an IMAC

Let this serve as a starting point.