LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Comma seems to disappear

Solved!
Go to solution

I'm writing some data to Excel using the Report Generation Toolkit. I'm writing a 2D array of double, and when I place this data in an array and display it in LabVIEW it gives me the right numbers with decimals. When I write the exact same data to Excel I get the right numbers but without decimals. For example: 1,23 becomes 123.

 

Decimal problem.gif

This is how I fetch the data, it's from a history node. The ouput array is used to calculate some other data and this is added to the array. This is the array that I write to Excel.

 

Does someone know why LabVIEW does this and how I could fix it?

0 Kudos
Message 1 of 8
(5,193 Views)

The culprit is the MS Excel. Once you see the data in Excel, select the data right click and go to Format cells. In that you can see an option called "Currency" select that and set the Currency type to None, do you see the change?

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 8
(5,184 Views)

That doesn't make a difference, the numbers in Excel don't have a comma so Excel can't just place one

0 Kudos
Message 3 of 8
(5,164 Views)
Solution
Accepted by topic author Jakhals

If you really want to pass the comma as it is from LabVIEW, then convert the values to String and then write it to Excel.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 4 of 8
(5,157 Views)

First, I am giong to restate your problem. The commas in your numbers are the decimal seperators. When you send the numbers to Excel with the Report Generation Toolkit, it is stripping out the commas.

 

So, are both LabVIEW and Excel (or perhaps Windows itself) set to use commas as decimal seperators? I would assume that you have it set up that way, but I just want to confirm. If so, it looks like a bug. You might want to call NI to see if this is a known issue. 

 

One way to get around it has already been suggested and that is to send it as a string. You might need to convert commas to points as well.

 

Good Luck,

0 Kudos
Message 5 of 8
(5,129 Views)

@Jakhals wrote:

I'm writing some data to Excel using the Report Generation Toolkit. I'm writing a 2D array of double, and when I place this data in an array and display it in LabVIEW it gives me the right numbers with decimals. When I write the exact same data to Excel I get the right numbers but without decimals. For example: 1,23 becomes 123.

 

Decimal problem.gif

This is how I fetch the data, it's from a history node. The ouput array is used to calculate some other data and this is added to the array. This is the array that I write to Excel.

 

Does someone know why LabVIEW does this and how I could fix it?


Well what are thos False constants doing on that Block Diagram?  Change them to true .  

Capture.PNG

Minutia can bite you if you don't read the help file carefully.


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 8
(5,120 Views)

I did read the help file, but those 2 blocks aren't used eh?

 

I converted them to a string and that helped me out, thanks!

0 Kudos
Message 7 of 8
(5,114 Views)

I did read the help file, but those 2 blocks aren't used eh?

 

I converted them to a string and that helped me out, thanks!

0 Kudos
Message 8 of 8
(5,114 Views)