hfettig Posted November 24, 2004 Report Share Posted November 24, 2004 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 String To Number'. 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. :headbang: Cheers, Heiko Download File:post-1022-1101330789.vi Quote Link to comment
Mark Balla Posted November 29, 2004 Report Share Posted November 29, 2004 The names of these functions is not clear. Fract/Exp String To Number accutally works on Dbl,Sng and Exp. not sure why they have fract in the name. Decimal String To Number should accually be Decimal String To integer If you use the Fract/Exp String To Number function instead of the Decimal String To Number you will get what your lookin for. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.