Reading Each Digit of a Number

Started by dmyers, May 05, 2010, 03:55:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dmyers

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

wapperdude

#1
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
Visio 2019 Pro

Paul Herber

#2
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.

Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

wapperdude

#3
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
Visio 2019 Pro

Yacine

#4
I would have thought that MID gives an error with a number, but it works just fine.
MID(yourfield,position number,1)
Yacine

Paul Herber

#5
Do you mean "Reading a digit in a number"? A cypher is something different.

Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

Yacine

#6
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
Yacine

Visio Guy

#7
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.
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

dmyers

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