LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Split string to array

Hi 

I needs to split at string to array 

I use this code but the decimals is gone.

What can I do?snip.png

0 Kudos
Message 1 of 10
(10,889 Views)

That would be because you are formatting it a an array of decimal integers (%d)  Try "%f" to format them as floating point numbersSmiley Wink


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 10
(10,884 Views)

Thanks but the result is the same 😞

0 Kudos
Message 3 of 10
(10,869 Views)

I can see that my delimiter was wrong but still same resultsnip.png

0 Kudos
Message 4 of 10
(10,863 Views)

@Michael.Koppelgaard wrote:

Thanks but the result is the same 😞


Not sure how but, do show the display style of the string constants and this is what I get.

nope.png


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 10
(10,852 Views)

Hi Michael,

 

maybe your computer is set to use a comma as decimal separator…

 

Try a format string of "%.;%f"! (Read the LabVIEW help for format strings!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 10
(10,851 Views)

Works for me if you use the same delimiter in both your string and the spreadsheet to array vi 

ae3.PNG

Right click on your string and select "\" codes display

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 7 of 10
(10,846 Views)

After changing my computer settlings from "," to "." and using this code I get the decimal but with comma ??

That's strange when I set the computer to "."

 

snip.pngCapture.PNG

0 Kudos
Message 8 of 10
(10,841 Views)

Hi Michael,

 

you need to restart LabVIEW before changes in your regional settings are applied…

Best regards,
GerdW


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

Restart helped  🙂

0 Kudos
Message 10 of 10
(10,829 Views)