At 11:36 AM -0500 3/18/04, Paul F. Sullivan wrote:
>LabVIEWers,
>
>If I use "Decimal String to Number" with an I32 zero as the default, convert "To 
>Double Precision Float", and then "Divide" by 1000, everything works fine for 
>positive and negative numbers.
>
>To save the conversion, I tried using a DBL zero as the default. For unsigned number 
>strings, this works fine as well, but if the string starts with a + or a -, the 
>string doesn't convert and I get the default value (LV5 to LV7). Does anyone know why 
>this happens? Is it a bug?

Use Scan from string instead.  You don't need a format specifier if there is a default 
value wired in.  But the Decimal String to Number obviously doesn't like +/- and only 
works on strings of decimal digits and not signs.  If you want tighter parsing you can 
specify a %d format string on scan from string or run it thru the string matching 
algorithm with "[+-]*[0-9]+" to check for a correct format.  This is an optional + or 
minus followed by 1 or more digits.

-Scott


Reply via email to