LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

displaying multiple numeric digits in one table

This maybe a silly question, but is there a way to configure a numeric table to display columns with different amounts of digits? (Such as having the first column consist of outputs with only one digit, while the second column displaying three.)

0 Kudos
Message 1 of 7
(3,837 Views)

You would have to do this with an array of strings. You could set the Number to Fractional String node to however many decimals you want depending on the cell and then output to your array.

 

Like this:

Number to Fractional.PNG

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 2 of 7
(3,824 Views)

I assume you mean an Numerical Array (2D)

The answer is NO.

All elements in an array share a single format. Each element has to be the same.

 

A "Table" is rendered to in LabVIEW as the "Table Control" which is a string output.

Each cell of a LabVIEW "Table" Control can have different formatting (Font ,Text Color, Background Color)

But they are all strings so you will need to convert your numbers to strings.

 

Depending you what your data looks like you could use an array of clusters where each row is a cluster with each item in the cluster with it own formatting. 

Omar
0 Kudos
Message 3 of 7
(3,806 Views)

Keeping everything as Float and not converting to string,

but convert your 2D array of floats to a 1D array of clusters of floats.

Then you can set different format for each column.

.

MultipleNumericDigits.png

Omar
0 Kudos
Message 4 of 7
(3,764 Views)

@Labrat212 wrote:

This maybe a silly question, but is there a way to configure a numeric table to display columns with different amounts of digits? (Such as having the first column consist of outputs with only one digit, while the second column displaying three.)


A table is just a 2D array of strings. If the strings represent numerics, you have full control how to format it. I don't see the perceived problem.

 

 

Message 5 of 7
(3,733 Views)

What you can do is having a subVI that strips decimals to your values, so basically you provide a 2D array of U8 containing decimals you wish for each value. Inside it strips from 1.23456 to be 1.23000 for instance, then in your 2D array control/indicator you can have the option to strip trailing zeros...

 decimals.png

0 Kudos
Message 6 of 7
(3,714 Views)

@Jimmy.chretien wrote:

What you can do is having a subVI that strips decimals to your values, so basically you provide a 2D array of U8 containing decimals you wish for each value. Inside it strips from 1.23456 to be 1.23000 for instance, then in your 2D array control/indicator you can have the option to strip trailing zeros...

 decimals.png


I like this idea. If OP can use an array instead of a table, this is the way to go.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 7 of 7
(3,705 Views)