Convert Exponential value into float value

Exponential format example 005.0000E-02 Result 0.05
public static double convertExp(String slice)
int i=0,j=0;
int symbolpos=0;
int sign=0;
int power=0;
StringBuffer PowValue=new StringBuffer();
StringBuffer ExpValue=new StringBuffer();
while(i<slice.length())
if(slice.charAt(i)=='-') {sign=-1;}               
if(slice.charAt(i)=='+' || slice.charAt(i)=='-') {
symbolpos=i+1;
PowValue.append(slice.charAt(symbolpos));
PowValue.append(slice.charAt(symbolpos+1));                    
if(slice.charAt(i)!=('e') || slice.charAt(i)!=('E'))
if(j<=(slice.length()-5))
ExpValue.append(slice.charAt(j));               
j++;
i++;          
int powInt=Integer.parseInt(PowValue.toString());
Double expFot=Double.parseDouble(ExpValue.toString());
if(sign==0)
return (expFot * Math.pow(10,powInt));
else if(sign==-1)
return (expFot/(Math.pow(10,powInt)));
else
return 1;
Function return double value
double tummy=convertExp(imageviewerdisplay.Slicethick);
float convertslicevalue=(float)tummy; //double to float......

Best 3rd post ever?:-) Except that this was the 1st post .. #2 & #3 are in the resurrected zombie.
{color:0000ff}http://forum.java.sun.com/thread.jspa?threadID=583688{color}
And, um, I've heard of a double chin, but what's this?double tummy=convertExp(imageviewerdisplay.Slicethick);db

Similar Messages

  • IPhone SDK: How to convert Pixel values into Point values

    UIScrollView has a property called contentSize. This takes values in points. How do i convert Pixel values into Point Vales?
    -TRS

    As far as I can tell, they're the same - I know they are in Photoshop at least. My 57x57 point Tab Bar icon is also 57x57 pixels.
    Hope that helps

  • How to convert a date value into week value?

    How to display the date value like '20010203'
    into the week number of the year 2001?
    When i type in the following sql
    select week(chg_time) from site;
    I got this error message
    ORA-00904: invalid column name

    use the to_char function, to format the date into a week number (then you might need to convert that to a number using to_number)
    select to_char( sysdate, 'WW') from dual`
    a description of datetime formats: http://download-west.oracle.com/otndoc/oracle9i/901_doc/server.901/a90125/sql_elements4.htm#48515

  • How to convert analog scalar into digital value

    I have the DAQ connected to a system that sends a digital 0 or 1 through the analog BNC connector. If I use DAQ Express VI, I can convert the dynamic data type into a boolean (rather than scalar) array so it's easy to check if the value is 0 or 1. Because I'm running the VI in real-time, I can't use dynamic-to-boolean array conversion. The output I get is a 1-D waveform array which will give me scalar values. The task has a voltage range of -10 to 10 mV. How can I convert that into a 0 or a 1? Should I set the voltage range to 0-5V and simply have an if statement that checks if the value is, let's say, greater than 2.2V (which will mean it's a binary 1)? Is there a better method?
    Thanks. 

    Hi abdel2,
    It sounds like you are trying to measure digital data from your system. If that is the case, you should be able to connect to a digital input line if your DAQ card had them. Then you can set up a digital acquisition in LabVIEW that will interpret the signal as a boolean input.
    If you are not able to do this, you can approximate the digital behavior by reading analog data, and pragmatically determining a threshold (for example 2.2V), though this is a less efficient way to do it.
    Regards,
    Stephen S.
    National Instruments
    Applications Engineering

  • Control a 3 phase motor and convert input voltages into pressure values.

    Hi,
    I'm in my 4th year at university and I have been given a project that involves the experimental investigation of the interaction between fishing gears and the seabed. The work will consist dragging full-size or scale trawl components along a channel containing typical seabed sediments. I aim to create a LabView program that will allow me to operate the motor and analyze the 6 transducers I will be using.
    For the motor I desire to be able to:
    1 - Start the motor.
    2 - Define the speed it accelerates to.
    3 - Have the ability to switch off automatically depending on its speed and distance it has to the end of the rig to avoid the trolley crashing.
    For the 6 transducers (4 pressures, 1 load cell, 1 horizontal displacement) I desire to be able to:
    1 - Convert the voltage signal into the relevant unit of measurement.
    2 - Record data at a rate of 10Hz.
    3 - Output the recorded data into a file and also onto graphs.
    I also intend to introduce an emergency shut down facility for the whole system.
    I have started doing the built-in tutorials so i am able to do the basic routines. However I have no idea where to start creating a program to control a 3 phase motor and to be able t convert voltages from transducers into pessures and distances.
    I have version 8.5 if anyone has any information or advice i would greatly appreciate it .
    Thanks,
    Grant.
    Message Edited by grantstephen on 03-14-2008 11:28 AM

    You should try in the LabVIEW forum.  This forum is for Employers with LabVIEW job openings.
    http://forums.ni.com/ni/board?board.id=170
    =============
    XP SP2, LV 8.2
    CLAD

  • 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

  • How to Change  Numeric Value into Character Value in Reports at run-time?

    Hi,
    I am creating some reports, in which i am facing a problem.
    i have an AMOUNT field of "NUMBER" data type in a table, I want to show the AMOUNT value in Character at run-rime.
    For example, if AMOUNT is 12000 then it should be converted into Character like "Twelve Thosand".
    Please help me to make it clear.
    Thanking you in advance.

    u can get decimal points through this function
    FUNCTION amt_2_word(amt varchar2) RETURN Char IS
    BEGIN
         declare
              --TYPE v_arr IS VARRAY(6) of varchar2(3);
              len number;
              i number;
              t_amt varchar2(100);
              t_word varchar2(20000);
              last_3rd varchar2(1);
              main varchar2(1000); -- number in format main.sub
              --v_main v_arr := v_arr('00','0','00','00','000');
              v_main1 varchar2(3) := '00';
              v_main2 varchar2(3) := '0';
              v_main3 varchar2(3) := '00';
              v_main4 varchar2(3) := '00';
              v_main5 varchar2(3) := '000';
              sub varchar2(1000);
              res_1 varchar2(32000);
              res_2 varchar2(32000);
              res_3 varchar2(32000);
              res_4 varchar2(32000);
              res_5 varchar2(32000);
              res varchar2(32000);
         begin
              t_amt := lpad(amt, 10, '0');
              len := length(amt);
              i := instr(amt, '.');
              if i = 0 then
                   main := lpad(amt, 10, '0');
                   sub := '';
              else
                   main := lpad(left(amt, instr(amt, '.')-1), 10, '0');
                   sub := rpad(right(amt, len - instr(amt, '.')), 2, '0');
              end if;
              v_main1 := right(main, 2);
              v_main2 := left(right(main, 3), 1);
              v_main3 := left(right(main, 5), 2);
              v_main4 := left(right(main, 7), 2);
              v_main5 := left(main, 3);
              if v_main1 <> '00' then
                   res_1 :=getTwo(v_main1);
              end if;
              if v_main2 <> '0' then
                   res_2 := getOne(v_main2) || ' Hundred ';
              end if;
              if v_main3 <> '00' then
                   res_3 := getTwo(v_main3) || ' Thousand ';
              end if;
              if v_main4 <> '00' then
                   res_4 := getTwo(v_main4) || ' Lac ';
              end if;
              if v_main5 <> '000' then
                   last_3rd := left(right(v_main5, 3), 1);
                   if last_3rd <> '0' then
                        res_5 := getOne(last_3rd) || ' Hundred ';
                   end if;
                   res_5 := res_5 || getTwo(right(v_main5, 2)) || ' Crore ';
              end if;
              res := 'Rupees ' || res_5 || res_4 || res_3 || res_2 || res_1 || ' ';
              if sub is null then
                   res := res || 'Only';
              else
                   res_1 := getTwo(sub);
                   res := res || 'and Paise ' || res_1 || ' Only';
              end if;
              return res;
         end;
    END;
    u write this PL SQL in ur databse and u can use this function and get amount to word

  • Comma separated column values into row values

    Hi all,
    i am selecting the data from TABLE A ( id number ,rights varchar2 ). result set as
    ID     RIGHTS
    1     M,P,Y,N,C,P
    4     N,E,A
    10     N,C,R,P
    but i want the output as
    ID     RIGHTS
    1     M
    1 P
    1 Y
    1 N
    1 C
    1 P
    4     N
    4 E
    4 A
    10     N
    10 C
    10 R
    10 P
    kindly share your idea's to get the desired results.
    thanks in advance
    Edited by: 887268 on Nov 30, 2012 11:12 PM

    Try this
    SQL> WITH a(id, rights) AS
      2  (
      3  SELECT 1, 'M,P,Y,N,C,P' FROM dual UNION ALL
      4  SELECT 4, 'N,E,A' FROM dual UNION ALL
      5  SELECT 10, 'N,C,R,P' FROM dual)
      6  SELECT id, regexp_substr(rights, '[^,]+',1,level) res
      7  FROM a
      8  CONNECT BY  level - 1 <= regexp_count(rights,',')  /*  regexp_count:- 11g */
      9  AND prior id = id
    10  AND prior sys_guid() IS NOT NULL /* sys_guid:- 11g */
    11  ORDER BY id
    12  /
            ID RES
             1 M
             1 P
             1 Y
             1 N
             1 C
             1 P
             4 N
             4 A
             4 E
            10 N
            10 R
            ID RES
            10 C
            10 P
    13 rows selected.Thanks!
    Edited by: Ashu_Neo on Dec 1, 2012 9:43 PM
    -- Added comment

  • How to add one value into Input Entry Screen of Element

    Hi ,
    How to change the "Input Value" of Element which has already been processed and assigned. Its not allowing to update even though its been date tracked.
    I want to add one more Value into Input Value screen.
    Thanks
    Ram

    You cannot remove existing input values or add new one if you have created any entries for the element
    to know more details to maintain an element you can refer the following link
    http://ramesh-oraclehrms.blogspot.com/2007/08/maintaining-element.html
    Regards
    Ramesh Kumar S

  • How to populate value node with values?

    Hi Experts,
    I have created a new view with a vlaue node of table type.
    How can I populate values into the value node?
    Which method will be useful?
    Is there any material for Web UI Programing?
    Please help me in this.
    Thanks,
    Adi.

    Hi Adi
    If ZVal is your value node then,
      DATA: lref_entity    TYPE REF TO cl_bsp_wd_value_node,
            lref_bo_coll   TYPE REF TO if_bol_bo_col,
            lref_data TYPE REF TO <<your ZStructure>>,
             ls_data type <<your ZStructure>>.
    ls_data-<<field1>> = 'XYZ'
    ls_data-<<field2>> = 'XYZ'
         CREATE OBJECT lref_bo_coll TYPE cl_crm_bol_bo_col.
          CREATE DATA lref_data.
          CREATE OBJECT lref_entity
            EXPORTING
              iv_data_ref = lref_data.
          lref_entity->set_properties( ls_data ).
          lref_bo_coll->add( lref_entity ).
          typed_context->ZVal->set_collection( lref_bo_coll ).
    Hope this was helpful.
    Best Regards,
    Lakshminarayana

  • Convert Exponential value to Float

    Hi all,
    I need to convert Exponential value to a numeric value as shown in the following example.
    My input is
    INPUT = 9.9999999E7
    The output should be
    OUTPUT = 99999999
    Is there any Function module?
    Can anyone help me out in this?

    hi,
    Check this link..exponential to number conversion

  • How to convert PM Module Breakdown Duration (AUSZT) floating point value into Minutes

    Hi Frnds,
    My requirement is to display a normal alv report. Out of which one of the filed is from VIQMEL-AUSZT (Breakdown Duration).
    Which is of Data type FLTP.
    Details:
    AUZTV
    AUZTV
    TIMS
    6
    Start of Malfunction (Time)
    12:39:19
    AUZTB
    AUZTB
    TIMS
    6
    End of Malfunction (Time)
    12:42:00
    AUSZT
    AUSZT
    FLTP
    16
    Breakdown Duration
    1.6100000000000000E+02
    Now I want to convert the value '1.6100000000000000E+02' into Minutes.
    Kindly let me know the solution.
    Note: I tried with standard FM 'PM_TIME_CONVERSION' and converted the break down value into hours.
    For example: 1.6100000000000000E+02 to 4,472222222222222E-02.
    But i want to convert the break down duration value into perfect minutes.
    With Regards,
    Sudhir.

    Simply equate to a variable of type P decimals zero. It should give you value in seconds. Divide it by 60 to have it in minutes.

  • Need to convert values into coma separated

    Need to convert values into coma separated
    I have a string value that stores data like 'NYK,IND,SGP,GER'
    FOR EXAMPLE
    V_CITY_CODE = 'NYK,IND,SGP,GER'
    When I query
    select * from city where city_code = V_CITY_CODE;I get no rows, this is because V_CITY_CODE has all city code as single code.
    I need a function to search , and replace with ','.
    I tried using instr and replace but was unable to convert it.
    could some one pls assist me.
    thanks in advance
    Saz

    Looking for this?
    SQL> select * from emp
      2  /
         EMPNO     DEPTNO ENAME                                 SAL DOJ       JOB
             1          1 Karthick                               80 03-DEC-11
             2          1 Karthick_1                             90 23-NOV-11
             3          2 Ram                                    80 03-DEC-11
             4          2 Ram_1                                  90 23-NOV-11
    SQL> var v_ename varchar2(1000)
    SQL> exec :v_ename := 'Karthick,Karthick_1'
    PL/SQL procedure successfully completed.
    SQL> select *
      2    from emp
      3   where ename in (
      4                     select regexp_substr(val, '[^,]+', 1, level)
      5                        from (select :v_ename val from dual)
      6                    connect by level <= length(val) - length(replace(val, ','))+1
      7                  ) 
      8  /
         EMPNO     DEPTNO ENAME                                 SAL DOJ       JOB
             1          1 Karthick                               80 03-DEC-11
             2          1 Karthick_1                             90 23-NOV-11

  • How can I convert (or switch) the RGB percent values from the LR histogram into RGB values which are shown e. g. in PS/CameraRAW?

    In LR 5.5 (same in previous versions) the RGB values in the histogram are shown in percent (relativ) values. I prefere to see the absolute values, but I can`t find any way to switch. Maybe this option is intentional disabled, because LR works in 16-Bit mode this would result in values up to 2^16. But as i compared the relativ values from LR with the absolute values from PS i run into a conversion problem. The following example shows the differences:
    CameraRAW : RGB, 128,0,0
    Lightroom: RGB, 43,8%, 19,0%, 6,2%
    CameraRAW: RGB, 0,128,0
    Lightroom: RGB, 29,8%, 47,5%, 17,5%
    Mainly i have two questions:
    1. Is there any possibility to change the percent RGB values in LR to absolut values?
    2. How can i convert CameraRAW values to LR values (see above)?

    TThe reason that a design decision was made from the beginning of LR to show only the percentage values was that RGB values are dependent on the color space and the LR histogram and numerical readout are derived from the Develop module's display space which is a hybrid color space with ProPhoto RGB primaries and the sRGB TRC. Thus the numerical values in the display would be different from the exported RGB image (in an orthodox space) and it was feared that this would be misleading. When soft proofing was introduced, because it involved converting the display to an orthodox space, it became possible to use the 0-255 scale in that mode.

  • How do i convert a float value to a double value?

    How do i convert a float value to a double value? HELP PLEASE!! im very stuck!! i gota float data type and i need to convert it to a double data type in order to use it in another operation.....
    thank u so much!

    safe dint realise ppl were so arrogant. thanks for the reply but less of the sarcasm!

Maybe you are looking for

  • Not sure how to use protected method in arraylisy

    Hi, Im wondering how to use the removeRange method in java arraylist, its a protected method which returns void. http://java.sun.com/j2se/1.3/docs/api/java/util/ArrayList.html#removeRange(int,%20int) So if my class extends Arraylist i should be able

  • [solved]dnsutils 9.4.2-1 Error "failed to prepare transaction"

    [root@arch-01 jada]# pacman -Syu :: Synchronizing package databases... core is up to date extra is up to date community is up to date :: Starting full system upgrade... warning: dnsutils: forcing upgrade to version 9.4.2-1 resolving dependencies... d

  • Account statement printing - single spool requests

    Dear SAP experts, We would like to use print program RFKORD10 for correspondence type SAP06 (account statements for customers) to print account statements for a range of customers, so in mass processing. I see that the standard behaviour of the progr

  • Error Brief : Guideline load error in 856_4010_UCS

    In 856 outbound: we are getting below error in the production environment,but it works fine in TEST environment. Error Brief : Guideline load error. Error Description Error : Guideline was not provided in selector configuration for level 'Group'. Ple

  • Posting Goods Receipt using DTW

    Hi Experts I am using DTW to post around 9000 Goods Receipt documents and I am having trouble getting the items to post at the correct price.   Each time I try to post SAP B1 (2007A) uses the Last Purchase Price price list even though I have a differ