How to convert a number to FLOAT with 9 decimal values.

Hi all,
I need to convert a number like '10.02' to a floating point number with 9 decimal values like '10.022111221'. I think that the right function is TO_BINARY_FLOAT, but how can I obtain 9 decimal values? If I use the following syntax:
select TO_BINARY_FLOAT(num) from table
I obtain a floating point values with a variable number of decimal numbers after the ".", instead I need 9 number after ".".
Regards,
Maurizio.

Hi,
the number I need to select is the result of a product, for example:
select (Num_A * Num_B) from Table;
Num_A has 2 decimal numbers, like 12.01 and Num_B could be: 12.111111111.
Now, Num_A * Num_B = 653.999999994
but I issue:
select TO_BINARY_FLOAT(54.00 * 12.111111111) from Table
I obtain:
654, a rounded value, but I need 653.999999994.

Similar Messages

  • How to convert MM:SS into Seconds with varying values of Minutes length.

    I have one table in Oracle where there is one Column "Duration" and it is having entries like
    59:00,
    30:00,
    59:05
    30
    120:45
    etc.
    These entries are in Minutes and Seconds with MM:SS Format.Where MM:SS stands for Minute and SS is seconds only.
    Minutes can be of Length 1 (i.e. 01:00) of Length 2 (18:00) of Length 3 (i.e. 200:00) of Length 4 (i.e. 1440:00).
    I need to convert these Minutes (MM:SS) only into Seconds and want seconds as it is using SQL Query.
    Note:-Here Duration will be in MM:SS format like 65:06,100:00,1200:30
    Minutes or it can be in seconds also 50,30 etc.
    DURATION column is VARCHAR2 and database is Oracle.
    Please suggest SQL Query and help me to convert it as it is needed badly.
    Thanks in Advance for Help and Inputs.Looking forward for all kind of Help.

    What yaar..
    I fforgot to multiply with 60
    sql>
    select duration,nvl(to_number(substr(duration,1,instr(duration,':')-1)),0)*60 mts_to_sec,
        nvl(to_number(substr(duration,1,instr(duration,':')-1)),0)*60+
         to_number(substr(duration,decode(instr(duration,':'),0,1,instr(duration,':')+1))) tot_sec
    from t;
    DURATION MTS_TO_SEC TOT_SEC 
    1:30     60     90 
    10:30    600    630 
    100:00   6000   6000 
    5512     0      5512
    08:30    480    510 
    1440:00  86400  86400
    Message was edited by:
            jeneesh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to count the number of digits before decimal value

    Hi I've a decimal value like this
    123,456.700000000000
    I need output as 6 (because I've 6 digits before decimal)

    Try
    Declare @d decimal(30,9)=123456.700000000000
    SELECT FLOOR(@d)
    SELECT len(FLOOR(@d))
    Thanks
    Manish
    Please click Mark as Answer if my post solved your problem and click
    Vote as Helpful if this post was useful.

  • Essbase 9.3 Calc scripts. Pb with dates. How to convert (string = number) ?

    Hello,
    I've a problem with Essbase(Planning?) Scripts on version 9.3. It looks simple but I do not find any (clean) solution :
    On my Essbase database, I have a member called "Reference_Date" on my axis Indicators. It is a date data type, that is to say, it displays a number corresponding to a YYYYMMDD format. For example : 20091029 for October 29th 2009.
    In calc scripts I often need to compare the month included in that "Reference_Date" with the current Member of my Time Axis (I have 12 Months members based on the format M02 for February for example). The final aim is to calculate a number of complete years since that "Reference_Date".
    But theses two elements are not of the same "type" (one is a number value and the other is a "member" in Time Axis). So I'm forced to convert one of this two elements in order to compare it.
    For example I can extract the month value of the "Reference_Date"' and put an "M" before it to have a Time member equivalent or I can convert the member Name M10 to a number (10))
    in both cases I have the same type problem : I don't know how to convert a string into a number nor how to convert a number into a string.
    (For example @CONCATENATE doesn't work with numbers). and that my only remaining problem.
    I didn't find any Essbase Function which do this (conversion number <=>string).
    Is anyone have an Idea ?
    Thanks for your help
    Best regards

    I don't know any way for you to compare your data against your metadata. Not directly. To me it makes little enough sense to try that I'm not surprised the developers didn't provide for it.
    I've converted member names to strings, manipulated the strings (calc script functions are not good at this), and turned them back into member names, but that's really the only use I've had for string manipulation. I don't think an equivalency operator even exists for string data. And I see no way to begin thinking of a member name, once converted to a string, as a number.
    It makes even less sense to me to try thinking of a data value as a string. Even text values in Sys 11 are stored as numbers. Not encoded characters, but just a number to look up somewhere.
    I think you can do what you want though, with something like this...
    IF (@ISMBR("FY08"))
    vYr = 2008;
    ELSEIF (@ISMBR("FY09"))
    vYr = 2009;
    ENDIF;
    IF (@ISMBR("M01"))
    vMth = 1;
    ELSEIF (@ISMBR("M02"))
    vMth = = 2;
    ENDIF;
    "Years_Since_Reference" = ((vYr * 100) + Mth) - ("Reference_Date" / 12);
    Obviously, the math will need some work, coz that doesn't actually work, but the logic above essentially turns your metadata into numbers, which is what you are after.
    Good luck,
    -- Joe

  • How to check the number of contacts with segment level 'food and beverage' in the segment builder?

    How to check the number of contacts with segment level 'food and beverage' in the segment builder?
    Do we have any table to check this.

    How to check the number of contacts with segment level 'food and beverage' in the segment builder?
    Do we have any table to check this.

  • How Can I replace newScale Text Strings with Custom Values?

    How Can I replace newScale Text Strings with Custom Values?
    How can I replace newScale text strings with custom values?
    All  newScale text is customizable. Follow the procedure below to change the  value of any text string that appears in RequestCenter online pages.
    Procedure
    1. Find out the String ID of the text string you would like to overwrite by turning on the String ID display:
    a) Navigate to the RequestCenter.ear/config directory.
    b) Open the newscale.properties file and add the following name-value pair at the end of the file:res.format=2
    c) Save the file.
    d) Repeat steps b and c for the RmiConfig.prop and RequestCenter.prop files.
    e) Stop and restart the RequestCenter service.
    f) Log  in to RequestCenter and browse to the page that has the text you want  to overwrite. In front of the text you will now see the String ID.
    g) Note down the String ID's you want to change.
    2. Navigate to the directory: /RequestCenter.ear/RequestCenter.war/WEB-INF/classes/com/newscale/bfw.
    3. Create the following sub-directory: res/resources
    4. Create the following empty text files in the directory you just created:
    RequestCenter_0.properties
    RequestCenter_1.properties
    RequestCenter_2.properties
    RequestCenter_3.properties
    RequestCenter_4.properties
    RequestCenter_5.properties
    RequestCenter_6.properties
    RequestCenter_7.properties
    5. Add the custom text strings to the appropriate  RequestCenter_<Number>.properties file in the following manner  (name-value pair) StringID=YourCustomTextString
    Example: The StringID for "Available Work" in ServiceManager is 699.
    If you wanted to change "Available Work" to "General Inbox", you  would add the following line to the RequestCenter_0.properties file
         699=General Inbox
    Strings are divided into the following files, based on their numeric ID:
    Strings are divided into the following files, based on their numeric ID:
    String ID  File Name
    0 to 999 -> RequestCenter_0.properties
    1000 to 1999 -> RequestCenter_1.properties
    2000 to 2999 -> RequestCenter_2.properties
    3000 to 3999 -> RequestCenter_3.properties
    4000 to 4999 -> RequestCenter_4.properties
    5000 to 5999 -> RequestCenter_5.properties
    6000 to 6999 -> RequestCenter_6.properties
    7000 to 7999 -> RequestCenter_7.properties
    6. Turn off the String ID display by removing (or commenting out) the line "res.format=2" from the newscale.properties, RequestCenter.prop and RmiConfig.prop files
    7. Restart RequestCenter.
    Your customized text should be displayed.

    I've recently come across this information and it was very helpful in changing some of the inline text.
    However, one place that seemed out of reach with this method was the three main buttons on an "Order" page.  Specifically the "Add & Review Order" button was confusing some of our users.
    Through the use of JavaScript we were able to modify the label of this button.  We placed JS in the footer.html file that changes the value of the butt

  • How to convert a number stored as text to as integer with formating

    Hi,
    Can someone say me how to convert a Numeric data that is stored in a Varchar column to an integer.
    Say, I have a Value "-.84566666" in a column which is of data type VARCHAR and I want to show this data as "-0.8456", i.e. I want to display it as an Interger after formating it to have only 4 decimal place value etc.
    Is there any inbuilt function in oracle for this?
    Thanks,

    Take a look at builtin TO_NUMBER / TO_CHAR functions.
    SELECT TO_CHAR(TO_NUMBER('-.84566666'), 'SD9999')
      FROM dual;C.

  • How to convert data read in byte to decimal number?

    The following are a source code to read from a serial port, but i can't convert the data that i read to decimal number and write it on a text file.....can anyone kindly show me how to solve it? thanks
    import javax.comm.*;
    import java.io.*;
    import java.util.*;
    public class Read implements Runnable, SerialPortEventListener {
         // Attributes for Serial Communication
         static Enumeration portList;
         static CommPortIdentifier portId;
         SerialPort serialPort;
         static OutputStream outputStream;
         InputStream inputStream;
         Thread readThread;
         public static void main(String s[])
         portList=CommPortIdentifier.getPortIdentifiers();
         while(portList.hasMoreElements())
              portId=(CommPortIdentifier)portList.nextElement();
              if(portId.getPortType()==CommPortIdentifier.PORT_SERIAL)
                   if(portId.getName().equals("COM1"))
                        System.out.println( portId.getName());
                        Read ss=new Read();
              }     // end of while
    }          // end of main
    public Read()     {
    try{
              serialPort=(SerialPort)portId.open("Read", 2000);
    catch(PortInUseException e)     {}
         try{
              inputStream=serialPort.getInputStream();
              System.out.println(inputStream);
    catch(IOException e)     {}
         try{
              serialPort.addEventListener(this);
    catch(Exception e)     {}
              serialPort.notifyOnDataAvailable(true);
         try{
              serialPort.setSerialPortParams(9600,
              SerialPort.DATABITS_8,
              SerialPort.STOPBITS_1,
              SerialPort.PARITY_NONE);
              }catch(UnsupportedCommOperationException e)     {}
              readThread=new Thread(this);
              readThread.start();
         }//end of constructor
         public void run()
              try     {
                   Thread.sleep(200);
              }catch(InterruptedException e)     {}
         public void serialEvent(SerialPortEvent event)
              switch(event.getEventType())
                   case SerialPortEvent.BI:
                   case SerialPortEvent.OE:
                   case SerialPortEvent.FE:
                   case SerialPortEvent.PE:
                   case SerialPortEvent.CD:
                   case SerialPortEvent.CTS:
                   case SerialPortEvent.DSR:
                   case SerialPortEvent.RI:
                   case SerialPortEvent.OUTPUT_BUFFER_EMPTY:
                   break;
                   case SerialPortEvent.DATA_AVAILABLE:
                   byte[]readBuffer=new byte[8];
                   try{
                        while(inputStream.available()>0)
                             int numBytes=inputStream.read(readBuffer);
                             //System.out.println("hello");
                        System.out.print(new String(readBuffer));
                        }catch(IOException e)     {}
                   break;
                   }     // end of switch
                   try     {
                        inputStream.close();
                        }catch(Exception e5)     {}
         }          // end of serialEvent

    Is it a float or a double?
    For a float, the decimal should be 4 bytes (small numbers like 1.1 start with the byte 0x40). Convert these 4 bytes to an int, using byte-shifting would probably be easiest.
    int value = ((b3 << 24) + (b2 << 16) + (b1 << 8) + b0);//b# are bytesNow to convert it to a float, use
    Float.intBitsToFloat(value);Now if you want double percision, You will have 8 bytes instead of 4, and need to be converted to a long instead of an int through byte-shifting. Then use Double.longBitsToDouble(long bits) to get the double

  • Need Help on How to Convert a Number Field to an Hour/Minute

    Post Author: syracuse2
    CA Forum: Crystal Reports
    I have a field that shows a duration, i.e. 125.  I would like to convert the number of 125 to 2hr and 5 min.  Any suggestions on how to do this?

    Post Author: GraemeG
    CA Forum: Crystal Reports
    Create a formula and paste the following into it (sorry I use Basic Syntax):
    'Ive laboured a point here a bit so you can get an idea of what you can do.
    'Heres 3 variables - one with your duration and two others for hours and minutesshared xDuration as numbershared xHours as numbershared xMins as number
    'Put some data into the duration and calculate the hours and minutesxDuration = 125xHours =  truncate(xDuration/60)xMins = remainder(xDuration,60)
    'You can then use the variables to get a string with unformatted hours and mins'formula = xHours + "hours " + xMins + "Mins"
    'or you format the hours and minutes nicely'formula = CStr(xHours,0) + "hours " + CStr(xMins,0) + "Mins"
    'or you can make it all into one formula without the need for xHours and xMins variablesformula = CStr((truncate(xDuration/60)),0) + "hours " + CStr(remainder(xDuration,60),0) + "Mins"

  • How to convert a number to duty cycle (FPGA)

    Hi
    I want to convert a numerical number to a duty cycle value in FPGA module so I could use it to generate a PWM signal for the numerical value.
    I tried dividing it but it shows an error in FPGA as it would produce a float value. I tried even the example of scaled division but the quotient is rounded of to 0 (I wanted to convert an output by multiplying 10/36).
    In my project the 100% duty cycle is 360 degrees and 0% is 0 degrees of the motor shaft rotation.
    Please help me I need to use it for my project.
    Thank you
    Dinesh

      I am not exactly sure how your duty cycle is setup, but here is a way we have used a number to create a PWM in our FPGA.
         If you have 360 deg. then I would guess you want to create a PWM duty cycle that is some fraction of 360, say "number"/360.  You could use a for loop where 360 is wired to the "N" and then your "number" can be compared to the current loop count.  That comparison would be true/false which could triger a DIO to be high or low.  Therefor, if   (loop count) < "number"  then DIO is HIGH,  if (loop count) >= "number then DIO is LOW.   This would send out a PWM that has a duty cycle of "number"/360, (multiply by 100 to get in %)  
         I hope this helps.
     --Alex--

  • URGENT!!!!!!! - CONVERT A NUMBER TO FLOAT

    Hi!
    I HAVE a NUMBER 0000.699 and I need it on  6.9900000E-01 format!
    HOW I CAN DO THAT????
    Please its urgent!!
    Tks in advance

    Hi,
        Check this FM "CTCV_CONVERT_DATE_TO_FLOAT" . It can convert any 30 digits of number to float.
    You can even copy the source code of this Function Module and extend it beyond 30 numbers.
    Reward points if useful.
    Regards
    Abhishek

  • How to convert dynamic disk into basic, with OS installed in C drive????

    Hi,
    I want to convert all volumes of my current hard drive (which includes OS installed in it) into basic from dynamic. 
    I read the tutorial of microsoft, in which they said that delete all volumes one by one and then finally convert the disk into basic.
    So I deleted 2 volumes, but OS did not let me delete C drive, as windows 8 was installed in it.
    So now how to convert my hard disk into basic disk from dynamic disk???

    Hi,
    I want to convert all volumes of my current hard drive (which includes OS installed in it) into basic from dynamic. 
    I read the tutorial of microsoft, in which they said that delete all volumes one by one and then finally convert the disk into basic.
    So I deleted 2 volumes, but OS did not let me delete C drive, as windows 8 was installed in it.
    So now how to convert my hard disk into basic disk from dynamic disk???
    find another hard disk, backup and wipe the old disk, then use windows to make sure any partitions remaining are gone
    windows will automatically allocate the disk as required on a new install
    Corsair Carbide 300R with window
    Corsair TX850V2 70A@12V
    Asus M5A99FX PRO R2.0 CFX/SLI
    AMD Phenom II 965 C3 Black Edition @ 4.0 GHz
    G.SKILL RipjawsX DDR3-2133 8 GB
    EVGA GTX 6600 Ti FTW Signature 2(Gk104 Kepler)
    Asus PA238QR IPS LED HDMI DP 1080p
    ST2000DM001 & Windows 8.1 Enterprise x64
    Microsoft Wireless Desktop 2000
    Wacom Bamboo CHT470M
    Place your rig specifics into your signature like I have, makes it 100x easier to understand!
    Hardcore Games Legendary is the Only Way to Play!

  • How can I to number the book with CS5? . Has anyone the same difficulty?

    Hi friends,
    Could you help me?. I need to number a book with Indesing CS5.
    I mean, I have differents documents und I want to mix in a book. With the previus I can number all the book and that's ok,  but with the new version CS5 I can't.
    I 've been following the manual's instructions but there's not result. The pages don't change the number und they are individually numbered.
    I think thay maybe that's is a problem with the version. Has anyonte the same difficulty?
    Thank you very much,
    Marisa

    Thank you for your email.
    Finally, we found the issue. It was a probleme with the install, because we kept the  "prioritys" ("preferencias" in Spanish, I don't know the real name in informatic language) of the previous version. We deleyed the application's "prioritys"  and that's ok.

  • How to get all parameter names along with their values in stored procedure which is being executed

    Im using sql server 2012, is there any possible way to get all the parameters of a stored procedure along with the values passed to it.
    I need these things to build a xml. I mean this should happen in the procedure which being executed and it should be common for all the procedures.
    For example, let us suppose we have to procedures,
    uspSave, @name='test' @age=20
    uspDelete @id=2
    now in uspSave procedure, i need to get @name, @age and the values 'test', 20 and in uspDelete, i should get @id with value 2.
    For getting the column names, i tried this,
    select parameter_name from information_schema.PARAMETERS where specific_name=OBJECT_NAME(@@procid)
    now is it possible to loop through the result of above query and can we get the values.

    I think  you need running SQL Server Profiler to capture this info even in SQL Server 2012.
    Best Regards,Uri Dimant SQL Server MVP,http://sqlblog.com/blogs/uri_dimant/
    Blog : MS SQL Development and Optimization
    Blog : Large
    scale of database and cleansing

  • How to preset fields in TA BP with default values

    Hi!
    I want to fill few fields in transaction BP with default values.
    This should be if there`s a new business partner to insert.
    If i can do this depending on the selected role it was the best
    First i thought on SPA/GPA-parameters ... but then i can`t do it in depence on the selected role.
    In customizing i can tell only if a field should be displayed or not, for input or not, ... but no values to insert.
    Is here anybody with a good idea for me?
    Thanks a lot in advance.
    Best regards,
    Ingo
    Edited by: Ingo Schmökel on Jul 1, 2008 7:20 PM

    Hi,
    There is one possibility which requires an enhancement of the
    BDT event ISDAT and a call to the function module
    BUP_BUPA_FIELDVALUES_SET. This means that an ISDAT function module needs to be written (transaction BUS7) which calls the function module BUP_BUPA_FIELDVALUES_SET with the needed values that are to be defaulted. You can read the role value using BUS_PARAMETERS_ISSTA_GET (T_RLTYP).The fields which are possible can be found in the DDIC structure BUSDEFAULT. However this is limited only to the fields inside this structure.
    Thanks and warm regards,
    Smita.

Maybe you are looking for