Exponential String to Number

Should be easy...but I'm getting hung up here:
I am trying to convert strings in the form 1.40E00 to doubles in the form 1.400.  I am using the "Fract/Exp String To Number.vi", but it does not recognize the decimal values and returns only the integer values.  When I set precision past the decimal place, it returns 1.000 rather than 1.400.  Should be simple, but its kicking my behind.  Any quick fixes?

Either your input to the function is wrong, or your method of displaying the output is wrong, the fucntions works fine unless you can show it not working properly.
Please post an example of it not working, with inputs as a constant.
Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.
Attachments:
Exponential String Conversion.vi ‏5 KB

Similar Messages

  • Expression Builder: convert string to number

    Hi all,
    I'm having trouble building a field validation rule for bank account numbers.
    The numbers have 12 positions, so I cannot use a string or text number.
    The validation rule to be implemented is that the last two digits are calculated based on the first 10 (modulo 97).
    However, when I use the Mid function to pick the first characters, I am unable to do any calculations on it. Apparently, the string to number conversion doesn't work (it should work when I read the manual, as it says that when using an operator between two data types, the second type is converted to the first (cf. example of 1234+abcd (should result in 1234 as to the manual))). So I tried '1*Mid(...)' or '0+Mid(...)'. Syntactically the expression builder accepts it and I can save it. BUT when I change the particular value on the screen, it gives me an SSO error (not the Field Validation error message I entered).
    Why isn't there simply a function ToNumber (like ToChar)????? How could I workaround this?
    Any input very welcome!
    Frederik

    Apparently, I was a bit confused when typing the first sentence, it should be:
    The numbers have 12 positions, so I cannot use an integer or number data type, but have to use String.

  • Converting string to number

    Why the number doesn't contain the whole string and how to solve it ? 
    VI is attached
    Solved!
    Go to Solution.
    Attachments:
    String to number.vi ‏7 KB

    MarinaNashaat wrote:
    binary bits
    What does that even mean?
    Post a screenshot of your VI with the data typed in.  Or put the data in the control.  Right click and save the value as defaul.  Save the VI and attach that.
    (Please put all of your information in one post.  No need to create another message.  You can even edit your previoius message within a reasonable period of time if you go to the options menu to the right of the message and choosed Edit Reply.

  • How to use type cast change string to number(dbl)?can it work?

    how to use type cast change string to number(dbl)?can it work?

    Do you want to Type Cast (function in the Advanced >> Data Manipulation palette) or Convert (functions in the String >> String/Number Conversion palette)?
    2 simple examples:
    "1" cast as I8 = 49 or 31 hex.
    "1" converted to decimal = 1.
    "20" cast as I16 = 12848 or 3230 hex.
    "20" converted to decimal = 20.
    Note that type casting a string to an integer results in a byte by byte conversion to the ASCII values.
    32 hex is an ASCII "2" and 30 hex is an ASCII "0" so "20" cast as I16 becomes 3230 hex.
    When type casting a string to a double, the string must conform the the IEEE 32 bit floating point representation, which is typically not easy to enter from the keyboard.
    See tha attached LabView 6.1 example.
    Attachments:
    TypeCastAndConvert.vi ‏34 KB

  • Output variable string or number consecutively

    Hello,
    I have an input signal of telephone digits and I am trying to output the digits on a string or number indicator one by one as they come out so that at the end I would have a full telephone number. I understand the logic to program it but I can't quite get a way to do it visually in LabVIEW. Can you help?
    Thanks,
    LD

    I'm trying to detect an 11-digit telephone number coming from a cable. I'm using an NI USB 6008 unit to get the signal in and then work out the numbers. What I have right now is LEDs flashing up for each number from 0 to 9.
    I've attached my file for reference.
    I have two side questions I'd like to ask. First one is about DAQ Assistant: you know when you're setting up the DAQ Assistant, there's sampling rate, acquisition mode and samples to read parameters, what exactly is the samples to read parameter? The help information said that it's the number of samples specified to read for N Samples acquisition mode or the buffer size for Continuous sampling acquisition mode.
    I've got a bit confused about this samples to read parameter because when I tried putting it at high values like 10k, the output of the signal on the graph indicator was going really slow, like it would take snap shots at long intervals. And when putting the parameter at lower values, the signal becomes more continuous. The same actually goes for the sampling rate which is even stranger.
    The second question is actually related to the above question. Every digit is dialed (automatically) every 40ms - on the oscilloscope it's like 40ms of waves and then 40ms rest and then 40ms of waves again, so that's like a pulse going at 12.5 Hz. But the waveforms have frequency components within the range of 0.5k to 2k. So my question is what determines the values I'd want to use for the above parameters (if any)?
    Sorry for the shabby drawing
    Attachments:
    DTMF Decoder.vi ‏280 KB

  • Fract/Exp String to Numbe Display Format

    I have a Numeric String which has a large decimal value, with the Digits of precision ranging upto 16 digits. I want to convert this String to a Numeric value and I have used a 'Fract/Exp String to Number'. In my VI I hae set:
    Data Type: EXT (because it allows Number of Decimal Digits from 15 to 20)
    Data Format: Floting Point
    Digits: 16
    Precision Type: Precision Digits
    The following is my question: If the input string has Precision Digits = 15 Eg: 5.369607712106161
    Then I am getting output = 5.3696077121061609, which is about the same, but not the same number I sent.
    or , String 1.145152879691825 gives me number = 1.1451528796918251
    String 5.818356760119754 gives me number = 5.8183567601197543
    Please suggest how I can make the output more precise. 
    Thank you.
    Regards,
    H.
    Solved!
    Go to Solution.
    Attachments:
    FractStringToNumber.vi ‏6 KB

    Hello Darin
    Thank you for the post. It worked!
    I do not understnd one thing: My  output number is EXT and the default value is also EXT with precision value set to 0. How does wiring the default value itself works, while not wiring it didnt work before!
    Thanks,
    H
    Message Edited by H P on 12-17-2009 03:45 PM
    Attachments:
    FractStringToNumber.vi ‏7 KB

  • Take the average of the measured values wich cannot be converted from string to number..

    Hello,
    I have a Keithley 182 Digital Nanometer (K182). I am usins it to measure voltage at high temperature. I want K182 to measure 3 times and then take the avarage of collected data.
    1. First problem is, as you can see from picture, string to number conversion. I tried many ways but I couldn't do it. Values as you see 0,00, and once was
    3,98E-3
    0,00
    392,0
    originan values were
    3,98E-3
    3,95E-3
    3,93E-3
    in table, values generally like this.
    2. I need to take avarege. So i need toindez data, then take avarage. So, I have also problem here...
    Could you please help on thic topic. Thanks in advance.
    Attachments:
    string-number.png ‏19 KB
    string-number-panel.png ‏30 KB

    thank you, I will try this solution. Also I want to do one more thing. So, I am collecting data and putting them in to table let say data are like this
    Temp1     Temp2   Volt
    123,3       234,5      ...
    234,4       567,7
    345,6       789,9
    456,7       678,8
    I want to put data with increment like this given below:
    No  Temp1     Temp2   Volt
    1    123,3       234,5      ...
    2    234,4       567,7    
    3    345,6       789,9
    4    456,7       678,8
    there are no exact number of data. the number of data can change from measurement to measurement (1000, 2000, 500 more or less). How can I program this increment in my system.
    My system is include LakeShore 336 temperature conroller and Keithley 182 Nanovoltmeter. I will set the temperature specified value from room temperature wtih specific ramp rate. Meanwhile I will measure the voltage from sample via K182. So, I can measure both temp, and voltage via taking help from u.

  • LV PDA 8.2 Hex String to Number Primitive BUG

    Attached is a LV Project used with a Windows Mobile 5.0 device.  The project is set to enable debugging and a breakpoint is set at the Hex String To Number VI primitive.  When I wire in a U8 type input, my WM5.0 device consistently crashes.  When I unwire the U8 type input, everything works fine.  Try the attached file with a real WM5.0 device.  Emulator mode may still work with the U8 input wired.
    Attachments:
    Hex String to Number Bug.zip ‏23 KB

    rberger:
    I just wanted to let you know that I have brought this issue up to
    R&D. They are now aware of it, however I cannot give you a
    timeframe on how long it would take to get back with me. I will surely
    contact post on this forum as soon as I have something to report.
    Again, thank you very much for bringing this up to our attention.
    Best Regards,
    Rudi N.
    Applications Engineer

  • Contatination string with number

    Hi,
    i have to concatinate string with number
    like
    create or replace
    PROCEDURE sp1(
    p1 NUMBER DEFAULT NULL
    as
    v_numId number(7,0)
    begin
    if v_numId is not null then
    --1)v_nstrQuery:='select * from abc where id=' || v_numId;
    --or
    -2)-v_nstrQuery:='select * from abc where id=' || cast( v_numId as varchar2);
    end
    else
    v_nstrQuery:='select * from abc ' ;
    end if;
    begin
    EXECUTE IMMEDIATE v_nstrQuery INTO v_strMeasurementBasis1;
    end;
    end;
    1) which one i should use from 1 and 2
    2) i also noticed that , it show blue curly line under varchar2 of line second saying. "syntex error expected : identifer number_datatype number"
    2) i noticed that begin and end; srounding execute immediate
    is not required , please suggenst should i use it or not.
    yours sincerly.

    See iin bold below
    create or replace
    PROCEDURE sp1(
    p1 NUMBER DEFAULT NULL
    as
    v_numId number(7,0)
    begin
    if v_numId is not null then
    --1)v_nstrQuery:='select * from abc where id=' || v_numId;
    --or
    -2)-v_nstrQuery:='select * from abc where id=' || cast( v_numId as varchar2);
    end
    else
    v_nstrQuery:='select * from abc ' ;
    end if;
    begin
    EXECUTE IMMEDIATE v_nstrQuery INTO v_strMeasurementBasis1;
    end;
    end;
    1) which one i should use from 1 and 2 first oneis fne, no need to cast to varchar2
    2) i also noticed that , it show blue curly line under varchar2 of line second saying. "syntex error expected : identifer number_datatype number"
    2) i noticed that begin and end; srounding execute immediate if you need to write / handle any exception begin and end should be there
    is not required , please suggenst should i use it or not.
    Edited by: Kiran on Dec 21, 2012 1:45 AM

  • Fract String to Number converts "700,5" to 700,49999999

    I found that for some numbers the Fract String to Number vi creates a small rounding error. As an example “700,5” converts to 700,49999999. (Se attached image and vi). Is there a way to fix this?
    To see this error you have to adjust the number of digits to display in the Display format property tab. Or you can try using the round to nearest vi which will round to 700 and not 701. (This was how I found the error 
    I’m using Labview 2009.
    Terje
    Message Edited by Terje on 02-08-2010 05:00 AM
    Message Edited by Terje on 02-08-2010 05:01 AM
    Message Edited by Terje on 02-08-2010 05:06 AM
    Solved!
    Go to Solution.
    Attachments:
    rounding error.vi ‏6 KB

    Gerd,
    i just searched in the web a little bit in order to shed some light on the issue. Sadly, i found no real "solution", but something interesting:
    Due to Wikipedia (See in chapter "Character Representation"), the rounding for floating point numbers is correct with 17 decimal digits for binary64 values (which LV-doubles are).
    I previously found out, that the change from 770.5 to 700.4999 is done if the number of significant bits in the display option is set to something higher than 17 (so 18 or above).
    I find this is a fascinating coincidence......
    Norbert
    Message Edited by Norbert B on 02-08-2010 07:52 AM
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Function to convert string to number

    Hi there,
    I wrote a function which converted a hor minute component of a date to a number. Now I need to do the same with a string (because the hours could be more then 23:95). Anyway here is my function. How can I rewrite it so it will accept a string as in parameter. Somwhow I can not work it out. Thanks a lot.
    Chris
    function calculate_hours_project(in_hours in DATE)
    RETURN number
    AS
    hrs CHAR(2);
    mins CHAR(2);
         BEGIN
              hrs := to_char(in_day, 'HH24');
              mins := to_char(in_day, 'MI');
              if hrs is not null and mins is not null then
              RETURN to_number(hrs + (mins/60));
              else
              RETURN 0;
              end if;
    END calculate_hours_project;

    Wouldn't it just be something like this?
    sql>create or replace function calculate_hours_project(in_hours in varchar2)
      2  return number
      3  is
      4  begin
      5    return to_number(substr(in_hours, 1, instr(in_hours, ':') - 1)) +
      6           to_number(substr(in_hours, instr(in_hours, ':') + 1) / 60);
      7  end calculate_hours_project;
      8  /
    Function created.
    sql>select calculate_hours_project('08:05') from dual;
    CALCULATE_HOURS_PROJECT('08:05')
                           8.0833333
    1 row selected.
    sql>select calculate_hours_project('35:34') from dual;
    CALCULATE_HOURS_PROJECT('35:34')
                           35.566667
    1 row selected.

  • How to convert exponential data into number for the downloaded excelsheet

    Hi
    I have downloaded one field data i.e. having char of 50,  into excel sheet and it is displaying as  exponential in the excel sheet. 
    The data numbers should display as text only i.e 1236547896321 and not exponential
    Is anyone can tell how we can do this
    Thanks
    Pallavi

    Hello Pallvai,
    The problem of exponential is with the excel. Excel converts the large numbet into exponential.
    To avoid this you can make the number into text then excel won't convert it into exponential.
    For that you can do a simple trick. Just prefix a single quote ( ' ) in the field.
    eg:
    field = 1236547896321.
    then,
    constants c_quote type c value '''.   "<-- single quote
    concatenate c_quote field into field.
    " This will make the EXCEL to consider this field as text not number and hence it will not be considered
    " as exponential.
    Hope this solves your problem.
    Regards,
    Sachinkumar Mehta

  • String exponent number to integer and double conversion

    Anyone who can help please,
    I am receiving data back from an Agilent E4407B with the noise figure option in the following form:
    +1.00000000E+008,+1.52799997E+001,+1.00000000E+009,+1.52200003E+001,+2.00000000E+009,+1.51099997E+001,+3.00000000E+009,+1.50799999E+001,
    for up to 401 pairs of frequencies and amplitude figures.  This is all coming back in one long string.
    I want to read the pairs of figures into a 2 dimensional array, so that the first part of the array has the frequency in an double format, but NO exponent, and the second part of the array has the ENR value agan in a double format and also with NO exponent.
    I have been using:
    double ENR_Data[401][2];
    Scan(Databuf,"%s>%401f[x]",&ENR_Data);
    This reads the data into the array, but retains the exponent - please can someone show me the correct Scan formatting functions to use so that I keep just the number, and loose the scientific exponent format?
    Many thanks for any help,
    Allen Cherry

    Allen:
    It doesn't matter how you represent the doubles: the compiler represents them the same.
    double a = 2000000000.00;
    double b = 2e9;
    As far as the compiler is concerned (and as far as you should be concerned), a==b.
    In your last reply, your interpolated value of (say) 25000000000 = 2.5e10, which is greater than 2e9 and 3e9.  You said you may have the wrong number of zeros in the example, but please make sure you have the right number of zeros in your code.
    Are you sure you are handling the array correctly?  Remember that the array subscripts are [row][column].  From your sample data, the frequency values are in column 0.  The first frequency value would be ENR_Data[0][0].  The second frequency value would be ENR_Data[1][0], followed by ENR_Data[2][0], etc.
    Check the code I included below.  It's based on the numbers shown in your example.  It correctly determines if a number is greater than or less than a desired interpolated point.
    P.S. What algorithm are you using to do you interpolation?  I don't even know why you are searching for a number greater than some known value: you should be interpolating between points read from the array.
    #include <ansi_c.h>
    #include <utility.h>
    #include <formatio.h>
    main()
     char Databuf[] = "+1.00000000E+008,+1.52799997E+001,+1.00000000E+009,+1.52200003E+001,"
         "+2.00000000E+009,+1.51099997E+001,+3.00000000E+009,+1.50799999E+001";
     double ENR_Data[401][2];
     double interpValue = 2.5E9;
     // same as
     // double interpValue = 2500000000.00;
     int i;
     Scan(Databuf,"%s>%401f[x]",&ENR_Data);
     for (i=0; i<4; i++)
      if (ENR_Data[i][0] > interpValue)
       printf("%f (%e) > %f (%e)\n",
        ENR_Data[i][0], ENR_Data[i][0],
        interpValue, interpValue);
      else
       printf("%f (%e) <= %f (%e)\n",
        ENR_Data[i][0], ENR_Data[i][0],
        interpValue, interpValue);
     printf("Press any key to continue...\n");
     GetKey();

  • Converting scientific notation string to number?

    This is raising an error:
    > ToNumber (u201C2.75E-05u201D)
    How do you convert scientific notation strings to numbers?
    This is coming from XML. I can probably have the XML written so that it's not scientific notation.
    Tim

    Here's a not-so-pretty way:
    Local StringVar Array x;
    Local StringVar mantissa;
    Local StringVar exponent := "0";
    // Split into mantissa and exponent parts.
    x:= Split("24.2233E+2", "e", 2, 1);
    mantissa := x[1];
    If (UBound(x) = 2)
    Then
        exponent := x[2];
    // CDbl cannot interpret leading positive sign, so removie
    If Left(mantissa, 1) = "+"
    Then
        mantissa := Right(mantissa, Length(mantissa) - 1);
    If Left(exponent, 1) = "+"
    Then
        exponent := Right(exponent, Length(exponent) - 1);
    // Compute number
    CDbl(mantissa) * 10 ^ CDbl(exponent);
    Sincerely,
    Ted Ueda

  • String to number and Number to String Problem!

    Hi All,
    In my report i ahve to display the Date.
    From DB i am getting 4 digit string( 2008). Using that i have to display as 08 - 09
    In that i used RIGHT function. it is diplayed as 08 - 9.
    when i take 2 character from right '08' is coming. Then i converted to number and added 1 to the year
    But it become 9 instead of 09.
    How to solve it.
    Thanks in advance.
    Saravanakumar.

    Hi,
    Shweta's answer is valid when you retrieve a date field from the database, as you have specified that you are getting a four digit string, you should use this formula.
    if length(totext(tonumber(right('2008',2))+1)) = 4
    then
    right('2008',2)'-0'left(totext(tonumber(right('2008',2))+1),1)
    else
    right('2008',2)'-'left(totext(tonumber(right('2008',2))+1),2)
    hope this helps!!!
    Thanks
    -Azhar
    Edited by: Abdul Rehman Mushtaque on Mar 29, 2009 10:29 AM

Maybe you are looking for

  • Is it a Lion issue?

    I installed OS Lion on to my iMac about a week ago. I have CS3 Design Premium installed. Apart from printing issues with ID and Illustrator, which I found the fix for, the programmes worked until today. Now they will no longer open and I get the foll

  • What is the "search folders" tab for and how to set it up?

    Since my scratch disk is on my external HD and my project files will be on my system drive I am wondering what location I should set the search tabs folders at. If anyone knows what this a tab does exactly I would like to know. I am under the impress

  • Including native database functions in partnerlink

    Is there a way to include native Oracle database functions (such as NVL) in the definition of a partnerlink based on a database adapter?

  • Recording Headset Recommendations Needed

    Hi everyone: I currently use Captivate to record CBT's, complete with recorded audio. I have been using a Plantronics headset (very similar to the Plantronics Audio 650 USB Multimedia Stereo Headset) and while it has been a great headset, the quality

  • No signal after updating i phone 3gs

    sir i a using my i phone 3gs i have a problem in it it was working fine before in 4.1 thn recently i have updated to 6 since then it shows no NO SERVICE i tried to do all the posibe ways ike reset settings and a those ways but my signal is not coming