Author Topic: Reading Each Digit of a Number  (Read 3810 times)

0 Members and 1 Guest are viewing this topic.

dmyers

  • Jr. Member
  • **
  • Posts: 13
Reading Each Digit of a Number
« on: May 05, 2010, 10:55:24 AM »
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
« Last Edit: May 05, 2010, 02:55:30 PM by Visio Guy »

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3881
  • Ideas Visio-lized into solutions
Re: Reading Each Digit of a Number
« Reply #1 on: May 05, 2010, 11:35:39 AM »
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
« Last Edit: May 05, 2010, 02:55:35 PM by Visio Guy »
Visio 2019 Pro

Paul Herber

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2992
    • Paul Herber's website
Re: Reading Each Digit of a Number
« Reply #2 on: May 05, 2010, 11:35:44 AM »
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.

« Last Edit: May 05, 2010, 02:55:43 PM by Visio Guy »
Electronic and Electrical engineering, business and software stencils and applications for Visio -

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

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3881
  • Ideas Visio-lized into solutions
Re: Reading Each Digit of a Number
« Reply #3 on: May 05, 2010, 11:47:33 AM »
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
« Last Edit: May 05, 2010, 02:55:49 PM by Visio Guy »
Visio 2019 Pro

Yacine

  • Hero Member
  • *****
  • Posts: 2715
Re: Reading Each Digit of a Number
« Reply #4 on: May 05, 2010, 12: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)
« Last Edit: May 05, 2010, 02:56:02 PM by Visio Guy »
Yacine

Paul Herber

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2992
    • Paul Herber's website
Re: Reading Each Digit of a Number
« Reply #5 on: May 05, 2010, 02:01:33 PM »
Do you mean "Reading a digit in a number"? A cypher is something different.

« Last Edit: May 05, 2010, 02:57:55 PM by Visio Guy »
Electronic and Electrical engineering, business and software stencils and applications for Visio -

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

Yacine

  • Hero Member
  • *****
  • Posts: 2715
Re: Reading Each Digit of a Number
« Reply #6 on: May 05, 2010, 02: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
« Last Edit: May 05, 2010, 02:58:02 PM by Visio Guy »
Yacine

Visio Guy

  • Administrator
  • Hero Member
  • *****
  • Posts: 1718
  • Smart Graphics for Visual People...n' Stuff
    • Visio Guy
Re: Reading Each Digit of a Number
« Reply #7 on: May 05, 2010, 02: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.
« Last Edit: May 05, 2010, 02:58:07 PM by Visio Guy »
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

  • Jr. Member
  • **
  • Posts: 13
Re: Reading Each Digit of a Number
« Reply #8 on: May 06, 2010, 02: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