LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

delete ending zero of a string

Solved!
Go to solution

Hi,
I want to convert an array of floats, for exemple [12,123; 1; -46,2] to a string (with array to spreadsheet string vi) .
Actually, I have the string : "12,123000      1,000000      -46,200000"
But i want to have : "12,123       1        -46,2", without the ending zeros, which are particulary useless, and take a big place when you save it to a file in txt.

 

Thanks for your help.

P.S : it's useless to propose to search the 0 after the ",", and delete them : this solution is verry horrible, and will take a lot of ressources with my big numbers of values.

V-F
0 Kudos
Message 1 of 2
(3,659 Views)
Solution
Accepted by topic author ramses64

Hi ramses,

 

read the context help for ArrayToSpreadsheetString, in the sentence for format string you click on "format string syntax" and then you see a table of all the formatting codes. This way you would have read about the "#" to remove trailing zeros...

 

So use a format string of "%#.6f" for your formatting...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 2
(3,658 Views)