Visio Guy

Visio Discussions => Programming & Code => Topic started by: smelvadj on January 14, 2020, 05:34:57 AM

Title: Visio cuts visPropTypeNumber to 4 decimals ?
Post by: smelvadj on January 14, 2020, 05:34:57 AM
Hi all,

I have a number in a shape. the type is 2= visPropTypeNumber, format is "0.00000000".

When i write e.g. 0.00005 in the shape data, then the number in the "value" field shows 0.0001. It rounds to 4 decimals!?

If i write 0.000005 then the "value" field shows 0.

It seems like visio only can handle numbers with 4 decimals !?

How can i solve this ?

I hope you can help.
Thanks!

Title: Re: Visio cuts visPropTypeNumber to 4 decimals ?
Post by: vojo on January 14, 2020, 06:07:10 AM
Why...you think you more decimal places will help something??

AFAIK there is no way to change such precision
Title: Re: Visio cuts visPropTypeNumber to 4 decimals ?
Post by: Hey Ken on January 14, 2020, 08:29:22 AM
Vojo:

   Given that one US dollar is currently worth about 0.0001 Bitcoin, let me add my two cents to the discussion (or should I say "my ₿0.000002") to point out that such precision can occasionally be helpful.  ;- )

   - Ken

Title: Re: Visio cuts visPropTypeNumber to 4 decimals ?
Post by: Hey Ken on January 14, 2020, 09:14:31 AM


Smelvadj:

   Maybe I'm missing something, but I played around a bit with this and had no trouble displaying out to eight decimals.  I saw two ways:

   On the shapesheet, in the Shape Data section, in the Format cell, I entered the value ="0.0000000" (with equals sign and quotes), and set the Value cell to 0.00000010.  When I display the shape data for the shape via right click, it shows that correct value.  I can also change it, and it does so correctly.

   Likewise, in any other shapesheet field, I used the FORMAT function to do the same thing, such as =FORMAT(User.TestField,"0.00000000") such that when I assign 0.000001 to User.TestField, the FORMATted cell contains the correct decimal value.  It also works in the Text Fields section when the tiny decimal is displayed as the shape's text.  Granted, sometimes Visio will round it to the nearest wrong value, but the FORMAT pictures override that.

   More info about the FORMAT function pictures can be found here (https://docs.microsoft.com/en-us/office/client-developer/visio/about-format-pictures).

   Good luck!

   - Ken

Title: Re: Visio cuts visPropTypeNumber to 4 decimals ?
Post by: wapperdude on January 15, 2020, 01:14:21 AM
Works with V2019, too.