LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Formatstring in 'Scan from String'

Hi!
i try to format a string (example 4.241) to a number, which looks same (4.241). I do that with Scan from string, but without any Formatstring he returns 4,00.
I havent any idea how these Formatstrings work, can someone please post me the correct string?

Thanks
Zwitsch
0 Kudos
Message 1 of 5
(3,301 Views)
Your system is set to use the comma as decimal separator and the the scan stops at the point in "4.241" giving 4,00. Set the format string to specify the decimal separator e.g. "%.;%f"


LabVIEW, C'est LabVIEW

Message 2 of 5
(3,301 Views)
Thanks a lot! It works perfectly!
Zwitsch
0 Kudos
Message 4 of 5
(3,301 Views)
Zwitsch,

There is some help for the format string, it's just a bit hard to find, if memory serves. I just looked, and it's very obscure indeed. You have to go to the LabVIEW user manual, which you can get to by going to the help from anything that uses a format string (I used "to Spreadsheet String"). You will get a link to the User Manual (PDF). The information is somewhere in Chapter 9, but the help file doesn't give really good instructions on finding the information in Chapter nine.

The useage of the format string is actually pretty simple. Once you learn the rules, you won't have any trouble.

Good luck.
0 Kudos
Message 3 of 5
(3,301 Views)
Labview uses standard ANSI "C" (programming language) format strings
in Scan From String etc. It also uses a subset of Regular Expression
pattern matching in the Match Pattern string function. Any standard C
programming reference will give you lots of examples of format
strings. GH
0 Kudos
Message 5 of 5
(3,301 Views)