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
(11,408 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
(11,403 Views)

Thanks but the result is the same šŸ˜ž

0 Kudos
Message 3 of 10
(11,388 Views)

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

0 Kudos
Message 4 of 10
(11,382 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
(11,371 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
(11,370 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
(11,365 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
(11,360 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
(11,354 Views)

Restart helped  šŸ™‚

0 Kudos
Message 10 of 10
(11,348 Views)