05-05-2011 04:50 PM - edited 05-05-2011 04:51 PM
Hi ppl,
I have very simple question. I want to convert string 5.3696075E-4 to the number. in my program it gives me only 5.
plz, help me.
Solved! Go to Solution.
05-05-2011 06:42 PM - edited 05-05-2011 06:43 PM
Hello,
One thing to check might be your "Display Format..." (right-click on the indicator) and make sure you're setting the number of significant digits, or digits of precision sufficient to show the complete value.
When you say you only get 5... I presume you mean 5E-4, or 0.0005 correct?
That could be just a display format issue then...
Does that help?
If not, can you post a screenshot of what you're seeing just in case? I say a screenshot because I'm seeing your code execute as expected, returning all the relevant digits in the numeric representation.
05-06-2011 06:20 AM - edited 05-06-2011 06:20 AM
Your operating system is most likely set to use a comma instead of a period as the decimal separator.
The Fract/Exp String to Number function has an optional Boolean input at the top. The default is True, telling LabVIEW to use the OS system setting for the separator.
Set the 'use system decimal point (T)' to False and that should allow you to convert the string properly...
05-06-2011 06:28 AM
yeah.. you're right .. thanks 🙂
04-25-2012 06:41 AM
hi
I have almost the same problem ,infact my project is GPS tracking with labview and Google Map. I have made good progress, but I'm stuck right now because actually I have a lot of points to place on my map,
latitude longitude
49,866872 8,641218
49,866873 8,641218
49,866873 8,641218
49,866875 8,641218
49,866875 8,641217
49,866875 8,641217
49,866875 8,641217
49,866875 8,641218
49,866875 8,641218
49,866873 8,641218
49,866872 8,64122
49,86687 8,64122
49,866872 8,641218
My issue is , I read a text file,and I would like 6 digits after the coma but the function give me juste four digits after the coma .... so could you tell me how I have to do?
Here is a piece of my program, the problem is that my numbers are displayed with two digits after the comma, while I want to have at least 6 see 7.
because right now I have the trick of default is '% .3 f' ...
04-25-2012 06:52 AM
Hi paco,
some thoughts:
1) There's a difference between "digits displayed" and "digits in memory". If it's only a display problem you have to edit the display settings of your numeric indicator.
2) Given your example I would use a format string of "%,;%f"
3) Setting the decimal digits in the format string is usually ignored when converting string to number, so there is no difference in using "%f" of "%.3f"...
04-30-2012 05:05 AM
I called NI few days ago, a technician helped me but it's still not working, my project works, but if I could display more digits after the decimal point, my points on my map would be more accurate..
Furthermore , do you how i could add a scale on my map?
thanks for your reply
04-30-2012 05:21 AM
Hi paco,
"but it's still not working, my project works"
Does it work or doesn't it work? You are unclear in that point... ![]()
"but if I could display more digits after the decimal point, my points on my map would be more accurate."
Just do so...
"do you how i could add a scale on my map?"
I don't know your VI nor do I know your map...
I can only guess: you draw your map in an indicator. Most (graphical) indicators in LabVIEW allow additional picture overlays, use them to show your scale in the map...
04-30-2012 06:24 AM
hi
"""but it's still not working, my project works"
Does it work or doesn't it work? You are unclear in that point..."""
My project works , but when I used a probe in order to see how many digits are there after the coma, I see juste 4 digits ,but I would like to be more accurate I need at least 6 or 7 digits..
"do you how i could add a scale on my map?"
currently ,I'm using google map, and i need a scale on it but I don't know
attached my project.
but add this figures on a editor
49,866872 8,641218
49,866873 8,641218
49,866873 8,641218
49,866875 8,641218
49,866875 8,641217
49,866875 8,641217
49,866875 8,641217
49,866875 8,641218
49,866875 8,641218
49,866873 8,641218
49,866872 8,64122
49,86687 8,64122
49,866872 8,641218
04-30-2012 06:38 AM - edited 04-30-2012 06:40 AM
Hi paco,
you must learn to differentiate between the number of digits displayed and the number of digits used internally! Any indicator can be configured to show more than 4 digits, but it's up to you to change that (yes, also for probes!)...
See attachment, it converts your string example into an array of DBLs. The DBLs are displayed with more digits than usual - it's configurable in the indicator properties!