07-21-2009 04:43 AM
Dear All,
I'm having problems converting a number array to a spreadsheet string with one decimal precision. The number array is quite long (>1000 elements). When I save the converted spreadsheet string (plus some text) to a txt-file and try to open it with Notepad, the opened file looks like the attachment. The file opens with Wordpad in correct form (see attachment). For saving I'm using Write to Text File -function.
I have also attached a picture of the subVI which converts the number array to spreadsheet string. Interestingly the saved file opens correctly when format string is set to %f.
I'm using LV8.5.
Thanks,
Markus
07-21-2009 04:57 AM
Hi Markus,
where is the problem if it works with %f? "f" is correct for floating point numbers.
Mike
07-21-2009 05:09 AM
I have also attached a picture of the subVI which converts the number array to spreadsheet string. Interestingly the saved file opens correctly when format string is set to %f.
This is expected. %.1f you have already used. What is the prob?
07-21-2009 05:12 AM
Hi Mike,
It works with "%f" but not with "%.1f". I would like to have precision of one digit after the decimal point. I have understood that "%.1f" would be the correct notation but when using that notation the resulting txt-file looks like the attachment.
Thank you for your reply,
Markus
07-21-2009 05:40 AM
07-21-2009 05:51 AM
Hi Markus,
for me it also works like shown in muks picture.
Mike
07-21-2009 06:03 AM
Thank you both for your answers,
I removed all the other stuff and left only Array to Spreadsheet String -function in my subVI and it worked too. I was thinking that could the problem lie in End of Line constants which Notepad would not recognise.
Thanks,
Markus
07-21-2009 06:05 AM
07-21-2009 06:05 AM
Even with 0.1f, i am able to get the file working properly with Notepad.
I built the code in LabVIEW 8.6 with the screenshot you have attached.
Regards,
Sundar Ganesh
07-21-2009 06:10 AM
I dont think so it is because of that.