LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Two Excel report generation problems concerning the decimal comma

Solved!
Go to solution

Hello good people, I'm experiencing some problem when trying to generate an Excel-report, please see image below:17347i177004194D4C015A

Note that excel removes the decimal separator in case of the number is >1 (so that 1,000 becomes 1000) and if the number is <1, excel interprets it as a text string (Excel say something like "The number in this cell is formated as text, or is preceded by an apostrophe"). How to get rid of these problems? I would like an integer to appear as the same integer in excel, and any number less than one to be interpreted as a number!

 

Thanks alot in advance!

0 Kudos
Message 1 of 8
(3,868 Views)

Try to disable the localized decimal point: Uncheck Tools -> Options -> Front Panel -> Use localized decimal point

and restart LV.

Message 2 of 8
(3,850 Views)

For me its a bug. Labview or Excel, you know?

Message 3 of 8
(3,831 Views)

Thank you for your answer Mr.. candidus!

 

Unfortunately, I won't be able to return to my labVIEW-program until next Thursday, but I figured I would get my question "out there", to let some of the brilliant minds get a go at it (cause I'm a newbie) 🙂

 

If I do disable the localized decimal point for this VI, do you think I will be able to use this as an subVI without changing the decimal separator-settings of the calling VI's?

 

My Excel also prefers floating numbers with a comma, but I can't understand why numbers less than one wont be treated as numbers right away?

0 Kudos
Message 4 of 8
(3,820 Views)

I think this solve the problem

António

17407i91C701940D60F3E3

Message 5 of 8
(3,793 Views)
Solution
Accepted by topic author OscarJ

 


If I do disable the localized decimal point for this VI, do you think I will be able to use this as an subVI without changing the decimal separator-settings of the calling VI's?

 

My Excel also prefers floating numbers with a comma, but I can't understand why numbers less than one wont be treated as numbers right away?


 

Hallo OscarJ,

 

unfortunately the decimal point setting is global so the calling VI is affected, too.

But there are other possible solutions: You can convert your double array into a string array. The "number to string" conversion functions allows to disable the localized decimal point explicitely:

 

17403i91238EF1DDE715C7

 

Now you can append the text to your report.

 

Your excel seems to interpret ',' as thousands separator and '.' as decimal separator, thus the incorrect number conversion. That seems to be a little bit strange since you say it prefers ',' as decimal separator... Perhaps it has something to do with the office report generation toolkit.

Message 6 of 8
(3,789 Views)

Well kudos to you guys!

 

Mr. candidus and Mr.   acardoso, both methods posted seems to solve both of my problems, thank you very much!

 

(It also worked to uncheck the local decimal separator, but the convert to string-options seems more suiting in my application)

 

As far I'm concerned, I consider this case closed 😄

0 Kudos
Message 7 of 8
(3,733 Views)

thanks candidus!!

0 Kudos
Message 8 of 8
(3,199 Views)