Visio Guy

Visio Discussions => ShapeSheet & Smart Shapes => Topic started by: dmyers on May 05, 2010, 03:55:24 PM

Title: Reading Each Digit of a Number
Post by: dmyers on May 05, 2010, 03:55:24 PM
Good morning,

I have a set of 10 (0-9) rendered number that I would like to use as a readout instead of just text.  I would like to group the numbers together and have each one read a place value of the input number.  I already have the equations set up to hide the numbers not read but I am not sure how to tell the pics to look at a certain place value of the input number.

For example, I input a value of 2390.  I would like to have one group of numbers read the 2, one group read the 3, etc...  I am not sure if this is possible or how it could be done. 

Any help would be appreciated.

Thanks,

djmyers
Title: Re: Reading Each Digit of a Number
Post by: wapperdude on May 05, 2010, 04:35:39 PM
There are a couple of shapesheet functions that ought to help with this, I can think of "left" and "right", but I believe there are others.  Here's a link showing the available functions:  http://msdn.microsoft.com/en-us/library/aa431851(v=office.12).aspx

HTH
Wapperdude
Title: Re: Reading Each Digit of a Number
Post by: Paul Herber on May 05, 2010, 04:35:44 PM
Could each digit be stored separately? You could store each digit in its own Custom Property (Shape Data) field, each digit is easily available and all the digits can be shown as text using 4 Insert -> Fields.

Title: Re: Reading Each Digit of a Number
Post by: wapperdude on May 05, 2010, 04:47:33 PM
The other function that ought to help is "mid", you can specify both position and length.  See the previous link, probably in the SDK if you've downloaded it.

Wapperdude
Title: Re: Reading Each Digit of a Number
Post by: Yacine on May 05, 2010, 05:17:55 PM
I would have thought that MID gives an error with a number, but it works just fine.
MID(yourfield,position number,1)
Title: Re: Reading Each Digit of a Number
Post by: Paul Herber on May 05, 2010, 07:01:33 PM
Do you mean "Reading a digit in a number"? A cypher is something different.

Title: Re: Reading Each Digit of a Number
Post by: Yacine on May 05, 2010, 07:09:58 PM
Das ist das was Leo für Ziffer zurück gegeben hat. ;D
But I'm fine with digit.
Guess I should leave the HELPer job to you.  :'( ;D
Title: Re: Reading Each Digit of a Number
Post by: Visio Guy on May 05, 2010, 07:54:28 PM
Wo wäre ich ohne Leo...habe sofort gedacht "Ziffer" als ich Cypher gesehen habe...

Note: original thread title was: Reading a cypher in a number, in case you are all wondering what we're on about...

Might be able to do some weird stuff with math too:

2390

INT(2390/1000) = 2
INT(INT(2390/100)/10) = 3
INT(INT(INT(2390/10)/10)/10) = 9
MODULUS(2390,10) = 0

But the string stuff seems easier.
Title: Re: Reading Each Digit of a Number
Post by: dmyers on May 06, 2010, 07:42:25 PM
Thanks for the replies.

Interesting interpretation Visio Guy, I went ahead and used the MID function and everything worked great.

Thanks for the input.

djmyers