LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Decimal String to Number

Hi,
I'm using the express subVI Decimal String to Number (All Functions>>String>>String/Number Conversion) to convert the string 1.0008 to its equivalent in decimals. In the help, it's said that I can wire the type of representation I want (defaut(0 I32)). But it's not said what constant number to wire to that input to have a double representation and not see my string 1.0008 becoming decimal number 1 instead of 1.0008. How can I have that DBL Precision and keep my decimal part? Thanks.

Phil
0 Kudos
Message 1 of 5
(4,238 Views)
"Decimal String to Number" will only return base10 integers.
If you want the convert the string '1.0008' to 1.0008, use "Fractional/Exp String to Number".
=====================================================
Fading out. " ... J. Arthur Rank on gong."
0 Kudos
Message 2 of 5
(4,236 Views)
You are using the wrong function. Decimal String to Number will only return a decimal integer. You can wire a DBL constant to the default input but all that will do is have your integer represented as a DBL - it won't add any decimal places. Instead use Frac/Exp String to Number or use the Scan From String with a %f format string.
0 Kudos
Message 3 of 5
(4,237 Views)

oops wrong message

Message Edited by mr_nice on 12-01-2006 07:04 AM

0 Kudos
Message 4 of 5
(4,000 Views)

Hello,

 

   Check out the attached program, it will certainly help you to get what you want.

 

Perkash Mohan Lal

Institute of Semiconductor Technology

Technical University Braunschweig

0 Kudos
Message 5 of 5
(3,985 Views)