ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

scan from string / minus

hi all
i try to scan a string which contains strings as: "20-20". So i've tried many options %f... but each time LabView returns "20"... How doing this ??
Thanx for answers

Matt
0 Kudos
Message 1 of 2
(2,852 Views)
This is the correct answer. %f interprets only numbers and either "," or "." depending on what your system uses as a decimal seperator.

If you want both numbers, you need to use a format specifier of %f-%f which tells the function to get two numbers seperated by a "-". This will return two values representing the numbers either side of the "-".

Alternatively, if the "-" is supposed to be a decimal point (The number should be 20.20) you can specify that the "-" should be used as a decimal seperator by using the format command "%-;%f".

Hope this helps.

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
Message 2 of 2
(2,852 Views)