LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

rounding numbers to the nearest integer in Excel

Solved!
Go to solution

Hello everyone.

 

I use a write to spreadsheet file to export my array to excel (csv format), but it rounds the numbers to the nearest integer.

 

integer.png

How can i solve that problem ?

 

My VI is uploadet

 

Thanks in advance

 

Oesen

Best regards

Oesen
0 Kudos
Message 1 of 20
(3,961 Views)

Isn't it a problem with how your Excel cells are configured?

Message 2 of 20
(3,959 Views)

well.. It can possibly be that. Do you know how to configure the cells to get rid of integers ?

Best regards

Oesen
0 Kudos
Message 3 of 20
(3,953 Views)

Look at the resulting file in a text editor (like notepad).  If the numbers look good there, then you know it is how Excel is formatting the cells.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 20
(3,949 Views)

Hi Oesen,

 

I think the problem is the different decimal separator used in LabVIEW vs Excel...

 

Use a format string like "%.;%f" when creating the csv file!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 20
(3,943 Views)

I have exported the data to a .txt file, and it still shows integers

 

integer.png

 

 

Best regards

Oesen
0 Kudos
Message 6 of 20
(3,940 Views)

@Oesen wrote:

I have exported the data to a .txt file, and it still shows integers

 

integer.png

 

 


Exported how?  Export from Excel?  Or just open your CSV file with a text editor?

 

The export from Excel will just give you the same mess that you see in the cells.  Open the CSV file directly in a text editor.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 20
(3,934 Views)

@GerdW wrote:

Hi Oesen,

 

I think the problem is the different decimal separator used in LabVIEW vs Excel...

 

Use a format string like "%.;%f" when creating the csv file!


GerdW,

 

If you look at the code, you will see that the format is "%.;%.2f".



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 20
(3,933 Views)

Hi crossrulz,

 

ahh I see...

 

@Osman:

Run your VI and attach the text file you created with that VI here...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 20
(3,929 Views)

Thanks for the answers

 

I opened my (Mappe 1.csv) file and saved it as a(Mappe 1.txt) file. After that, i changed my file path in the "write to spreadsheet file" box from (Mappe 1.csv) to (Mappe 1.txt), and tested it.

Best regards

Oesen
0 Kudos
Message 10 of 20
(3,928 Views)