LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Decimal String to Number conversion problem

I have a string variable, which contains an integer number representing a floating point value with one decimal., e.g. -321 -> -32.1

In order to convert the string to a double variable I use the 'Decimal String To Number' function and divide the result by ten. This works fine if nothing or an Integer constant is wired to the default value. It properly converts -321, 321 and +321.

To avoid the coercion dot at the devision function I wired a double constant to the default value of 'Decimal Integer To String'. This changes the output wire to double and the coercion dot disappears. So far so good. However, now only 321 is properly converted -321 and +321 are not converted and the default value is put out.

The same happens for extended, single, and any unsigned integer values wired to the default value.

Granted, I can easily work around the problem, but I wanted to check if anybody has an explanation for this behaviour.

I tried it in 7.1, 7.0, and 6i: same behaviour everywhere.

Cheers,
Heiko
Message 1 of 5
(3,996 Views)
Sorry, it should read 'Decimal String to Number' everywhere I describe the function. 😉
0 Kudos
Message 2 of 5
(3,993 Views)
For floating point numbers you should be using 'Fract/Exp String To Number'.
authored by
Christian L, CLA
Systems Engineering Manager - Automotive and Transportation
NI - Austin, TX


  
0 Kudos
Message 3 of 5
(3,990 Views)
I think that this is a bug : the problem is not related to float numbers, but to negative integers ! The function should return the correct value, as it was intended to do, since there is a specific input for this.

Good catch !
Chilly Charly    (aka CC)
Message 4 of 5
(3,976 Views)
Good catch indeed! I have submitted this as a bug to be fixed. Thank you!!

Kileen C.
NI
0 Kudos
Message 5 of 5
(3,920 Views)