LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Formatting Columns in a Table -- Beginner

I am building a table from a 2D array. The 2D array is built from 3
1D arrays (1 is I16 integer numbers, 1 is doubles with 2 decimal place
precision, and 1 is doubles with 4 decimal place precision). The only
way I can get the correct representation in my table is by having all
3 columns display with 4 decimal places. However, I need them to all
display accordingly (the first column with no decmials, middle column
with 2 decimals showing, and the last column with 4 decimals showing).

Do I need to change the way I am building the table alltogether, or is
there a way to control this formatting easier? Any help or direction
would be greatly appreciated. Thank you in advance.
0 Kudos
Message 1 of 4
(3,319 Views)
I would rather display my table using 2D text array. the number arrays can be formatted to string arrays with desired presentations.

tc phan
Message 2 of 4
(3,319 Views)
Lindsey,
Arrays are collection of same datatypes and so the limitation. But you can get around it either by converting them to strings or the other option is to use the 'Format Into File' function from the file I/O subpalette. You do not have to convert your datatype to string and can wire then directly. You can specify the representation and digits of precision too. You can save this as an .xls file and open in Excel to obtain the desired table(Refer the attached diagram).

If you wish to display it on the labview frontpanel you can use the string table or if you wish to get fancy you can place that excel table on the frontpanel with a excel activex object.

Hope this helps,

Pravin
0 Kudos
Message 3 of 4
(3,319 Views)
Lindsey.Flash@grc.nasa.gov (Lindsey) wrote in message news:...
> I am building a table from a 2D array. The 2D array is built from 3
> 1D arrays (1 is I16 integer numbers, 1 is doubles with 2 decimal place
> precision, and 1 is doubles with 4 decimal place precision). The only
> way I can get the correct representation in my table is by having all
> 3 columns display with 4 decimal places. However, I need them to all
> display accordingly (the first column with no decmials, middle column
> with 2 decimals showing, and the last column with 4 decimals showing).
>
> Do I need to change the way I am building the table alltogether, or is
> there a way to control this formatting easier? Any help or direction
> would be
greatly appreciated. Thank you in advance.

Convert each of the 3 1D arrays to string arrays individually using
the appropriated number-to-string conversion functions. Then combine
the 3 resulting 1D string arrays into a 2D string array which you can
view with a table indicator.
0 Kudos
Message 4 of 4
(3,319 Views)