LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to find the length of a number in labview?


@rolfk wrote:

@paul_a_cardinale wrote:

If the number is in a control or indicator, you can do it like this:

Num_Len.png


I wouldn't account that as solution for floating point numbers. It will only depend on the selected display format and has almost nothing to do with the actual number.

 


Very old thread resurrection! 😄

 

As long as we work with positive integer values (DBL representation), a small change would make it work:

 

altenbach_0-1580595003783.png

 

(Still, my earlier solution is probably better... :))

0 Kudos
Message 11 of 13
(724 Views)

@altenbach wrote:

Very old thread resurrection! 😄

Didn't check the post date but it appeared on the first page of the overview and was marked as solution.

 

As long as we work with positive integer values (DBL representation), a small change would make it work:


I would think that changing the front panel appearence of a control for such side effects is not what one usually should attempt to do. Definitely would consider the original approach of just formatting the number into a string and measure the length a lot better and personally prefer your mathematical approach above anything else.

Rolf Kalbermatter
My Blog
0 Kudos
Message 12 of 13
(704 Views)

Oh, yes, you are definitely right that it is not the solution and I unmarked it as such. 😄 Not sure why the thread was showcased on the front page....

 

(It gets even weirder if you would blindly use a "%d" format on an DBL. While one might think that this will correctly display all possible DBL values as integers, the display will be coerced to the valid I64 range and thus wrong for large numbers... :o. For example 1E88 will be displayed as 9223372036854775807, not quite the same. 😉 I think this has been discussed in the past)

 

altenbach_0-1580672310761.png

0 Kudos
Message 13 of 13
(687 Views)