10-27-2021 09:21 AM
Hello,
returned string results from an instruments with VISA are always returned with a point.
Depending on the windows installation they must be converted to a value with a comma.
Attachached an snippet of a conversion.
Will this work for all regions? (Using a comma or point)?
What is the meaning of the %Le ?
Thanks
Solved! Go to Solution.
10-27-2021 09:37 AM
Comma or point makes sense only for string conversion. Numerically across the world, the value does not change. Now, when you convert this number again to a string, at that point you've to tell the string format function to use the local decimal separator.
In the snippet you've shared, it looks for a value with a dot separator and converts it into a number. You can understand what each specifier means by double-clicking on the Scan from String function which displays the window as shown below.
10-27-2021 09:49 AM
Yes, i want to convert a string to a numeric value.
The string is returned from the instrument and i need it as a numeric value.
Depending on region settings the string 1.23 should be converted to "1,23" or stay on "1.23".
What is the meaning of the "L" in the format specifier?
Thanks
10-27-2021 11:15 AM - edited 10-27-2021 11:18 AM
A number is a number. They are represented as bytes in memory and have no format until a human needs to see it. If you want to display it as something other than what your localization settings tell it to display it as, convert it into a string with that decimal format specifier.
11-04-2021 04:43 AM
What is the meaning of the "L" in the format specifier?
11-04-2021 08:31 AM
Click on the "Help" button to find out.
11-04-2021 08:44 AM
Help for "Scan Value, format specifier syntax" was not helpful regarding the "L".
11-04-2021 08:58 AM
"%Le" conversion code had me stumped as well... and I have been using LabVIEW for a very long time. LV help provides a lot of different values but "%Le" is not one of them.
I had to resort to googling the meaning, and it turns out that it is just a "Long Double". Some archaic C formatting code.
%Le long double x (long double)x
Found it on this page.
11-04-2021 09:04 AM
I cannot find anything on "L" in the help. Is it for "Long?" Is it a unit? LabVIEW does not complain when it's there, but I could not find an effect despite of many attempts.
11-04-2021 11:08 AM
@OnlyOne wrote:
Help for "Scan Value, format specifier syntax" was not helpful regarding the "L".
My apologies, OnlyOne. I had no idea it wasn't available from the dropdown menu (and therefore, not in the help file). I did not consider that the format specifier was added manually.