How do you retain only fractional part of number

If I have a number say 3.10383, how do I use only the fractional part? In other words, how do I get rid of the three? My ultimate goal is to add two values of hours, minutes and seconds, say 1 hour, 30 min, 4 secs plus 2 hours, 7 min, 2 secs as an example. Any help would be appreciated.

afried01 wrote:
If I have a number say 3.10383, how do I use only the fractional part?Most likely you want to do this:
double x = 3.10383;
double fracPartOfX = x - (int)x; //integer cast amounts to simple truncation You might as well check java.lang.Math, which contains methods like round, floor and their siblings.
My ultimate goal is to add two values of hours, minutes and seconds, say 1 hour, 30 min, 4 secs plus 2 hours, 7 min, 2 secs as an example.Is the need for the fractional part trick related to actually performing the sum or just to displaying the results?

Similar Messages

  • How do you use only a part of a song from itunes and add it to a movie project?

    After I've added video clips and photoes to a movie project, I can't figure out how to use only clips from itunes songs to play in specific parts of movie project...any ideas?

    The settings you use to play in iTunes do not get retained in other apps. What you can do is open Garage Band, drag the song from iTunes into a GB track, then edit the song as you like. You can even adjust the fade in/out exactly to the length and duration you want. When the song is trimmed, Share to iTunes, where it will become a separate song. Select that for your slideshow, or place it in an iTunes playlist and use the playlist for your slideshow.
    Regards.

  • How do you get only a contacts mobile number to show up when sending text....

    On the Droid, when you typed a contact in the "To" line of a text message, only their mobile number  showed up.  On the Droid X, all contacts phone numbers show up.  Very annoying. Anybody know how to fix this? Thanks in advance for any help/suggestions.

    Check the settings for your messaging app and see if there's a show only... option. I use handcent on my Eris and I know it has the option.

  • How can I delete only one part of my xml file?

    Hello,
    I stored more than 100 users in only one xmltype column. For instance
    Create table agro(users XMLTYPE);
    ... and I inserted all users inside
    INSERT INTO agro values(XMLTYPE
    ('<?xml version="1.0" encoding="ISO-8859-1"?>
    <authentication><users><user>
    <name>cocoon</name>
    <password>cocoon</password>
    <role>admin</role>
    <title>Mr.</title>
    <firstname>Walter</firstname>
    <lastname>Cocoon</lastname>
    <company />
    <street />
    <zipcode />
    <city />
    <country>DE</country>
    <phone />
    <fax />
    <email />
    <bankid />
    <bankname />
    <accountid />
    </user>
    ... another user, etc.
    </users></authentication>'));
    Now I tried to delete only one part of this file. For example all persons with the name"cocoon".
    I used for this target the following statement:
    DELETE FROM agro agro
    WHERE agro.users.extract('authentication/users/user/text()').getStringVal()= 'cocoon';
    When I execute this statement, Oracle DB delete all users and not only with the name "Cocoon".
    How can I delete only one part of my xml file?
    Kind Regards
    M R

    This the expected behavoir. You uploaded a document containing multiple users and then asked XML DB to delete any documnet that contained a user with the name in question. The problem here is that you are creating a mega document that contains an aggregation of user documents but then trying to work with individual user documents. This is a bad idea.
    In general XML does not understand the concept of a collection of documents. It can only operate on one document at a time. Hence the tendancy to aggregate individual documents into a single larger document. Once you have an XML database, you can perform operations on collections of document, as easily as you can perform operations on individual documents, so the need to aggregate the individual documents together disappears.
    If you store each user document as a seperate document then your delete will work as expected.

  • Mysql datetime datatype, from that datetime how can i compar only time part

    Hello i have database table in mysql, there is Datetime datatype column, from that datetime how can i compare only time part .....??
    Thanks in advance...

    Note you can't simply just compare time via equality however.
    Timestamp resolution is to the second or even milli-second. No user wants to match a time to an exact millisecond.
    What they want is something like a match by hour - for example returning the number of transactions that happened from 1pm to 2pm. Even that isn't completely correct because then you need to consider whether 1pm and/or 2pm is inclusive or exclusive. Normally one end will be inclusive and the other exclusive.
    So first you need to define what the period is.
    Then construct the range.
    Then pass the range and, as already mentioned, use specific functions to handle the extraction of the time.

  • How do you cut out the part of an image in a photo?

    How do you cut out a part of an image on a photo that you have added to Pages. For example, if I have added a picture of a giraffe to Pages how would I cut out the giraffe from the image and get rid of the rest of the image

    You can use the instant alpha tool to make the background transparent.
    FYI: Pages is part of iWork, not iLife.

  • How do you show only one caller's video display wi...

    How do you show only one caller's video output with four people sharing a video call? i.e. the call originator wants to show a DVD video on a TV screen and the other callers want to view the video on full screen not just one fourth of their screen.

    Thought I'd try this just in case they are stripping out attachments.
    Gary Grow
    6457 Audubon Sq Dr N
    Mobile, AL 36695
    Email: [email protected]
    Cell: (251) 422-8817
    The American Creed by William Tyler Paige
    I believe in the United States of America as a government of the people, by the people, for the people; whose just powers are derived from the consent of the governed, a democracy in a republic, a sovereign Nation of many sovereign States; a perfect union, one and inseparable; established upon those principles of freedom, equality, justice and humanity for which American patriots sacrificed their lives and fortunes. I therefore believe it is my duty to my country to love it, to support its Constitution, to obey its laws, to respect its flag, and to defend it against all enemies.

  • How do you sync only selected songs to your ipod using the new version of itunes?

    how do you sync only selected songs to your ipod using the new version of itunes?

    Same way you did with the previous versions of iTunes.
    To view the iPod in iTunes, Ctrl S to show the sidebar.
    Create a playlist, add songs and sync that playlist.
    Or drag songs to the iPod in iTunes.

  • On an i Phone 4, how do you reply only to the sender of a text message which is sent to a group of people?

    On an I phone 4, how do you respond only to the sender of a text message which has been sent to several people> Our replies always go to all the recipients of the original text. Thanks

    Start a new text message only to that person, not in the group text.

  • How do you preview using a spool request number

    How do you preview using a spool request number?
    I have an application in which I have accumulated the results from several smartforms into one spool request. I have the spool request number, and am printing it using function RSPO_RPRINT_SPOOLREQ.
    I need to be able to preview the contents of the spool request before printing. I can not preview when generating the smartforms, as that involves several previews, and I need to preview once only per spool request.
    I have been trying to use RSPO_RDISPLAY_OUTREQ but it dumps immediately (line 47) with field symbol <FTSP01> not assigned.
    Suggestions?

    *With no faction module "COM_SE_SPOOL_DISPLAY", try this simple code, you can display the form *type spool (you also can put the code in a function module):
    REPORT  ypl_test_display_spool MESSAGE-ID zm_print.
    PARAMETERS: rqident LIKE tsp01-rqident,
                            rqdocty LIKE tsp01-rqdoctype.
    *--- there may be more types need to separate..., so use case...
    CASE rqdocty.
      WHEN 'OTF' OR 'SMART'.
        PERFORM display_form.
      WHEN OTHERS.
        PERFORM display_others.
    ENDCASE.
    *&      Form  DISPLAY_FORM
          display form type spool...
    FORM display_form.
      DATA: wstr_otf_control TYPE itcpp.
      DATA: wtbl_buffer TYPE TABLE OF soli WITH HEADER LINE.
      DATA: wtbl_otf TYPE TABLE OF itcoo WITH HEADER LINE.
      DATA: wstr_retcode LIKE itcpp.
    *--- return spool raw data
      CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
        EXPORTING
          rqident              = rqident
        TABLES
          buffer               = wtbl_buffer
        EXCEPTIONS
          no_such_job          = 1
          job_contains_no_data = 2
          selection_empty      = 3
          no_permission        = 4
          can_not_access       = 5
          read_error           = 6
          type_no_match        = 7
          OTHERS               = 8.
      IF sy-subrc <> 0.
        MESSAGE s013 WITH text-001.
        EXIT.
      ENDIF.
      LOOP AT wtbl_buffer .
        wtbl_otf-tdprintcom = wtbl_buffer(2).
        wtbl_otf-tdprintpar = wtbl_buffer+2.
        APPEND wtbl_otf.
      ENDLOOP.
    *--- some data to pass to this parameter, may not need...from SP01...
      wstr_otf_control-tdcopies = 1.
      wstr_otf_control-tdappl = 'TX'.
      wstr_otf_control-tddest = 'LOCL'.
      wstr_otf_control-tdpages = 0.
      wstr_otf_control-tdnoprint = 'X'.
      CALL FUNCTION 'DISPLAY_OTF'
        EXPORTING
          control = wstr_otf_control
        IMPORTING
          RESULT  = wstr_retcode
        TABLES
          otf     = wtbl_otf.
      IF wstr_retcode IS INITIAL.
    *--- message...
      ENDIF.
    ENDFORM.                    "DISPLAY_FORM
    *&      Form  display_others
          display other types, may more types needed to separate...
          you can refer current version of SAP report RSPOLST2
    FORM display_others.
      CALL FUNCTION 'RSPO_DISPLAY_SPOOLJOB'
        EXPORTING
          rqident              = rqident
        EXCEPTIONS
          no_such_job          = 1
          job_contains_no_data = 2
          selection_empty      = 3
          no_permission        = 4
          can_not_access       = 5
          read_error           = 6
          OTHERS               = 7.
      IF sy-subrc <> 0.
        MESSAGE s013 WITH text-001.
      ENDIF.
    ENDFORM.                    "display_others

  • How to you get the percentage of a number in an array in ipad numbers

    How to you get the percentage of a number in an array in ipad numbers?

    Try asking here
    https://discussions.apple.com/community/iwork/numbers
    it's a part of the forum dedicated to numbers.

  • How do you get the percentage of one number compared to the sum of the total in an array in ipad numbers

    How do you get the percentage of one number compared to the sum of the total in an array in ipad numbers

    On the iPad my example looks like this:
    To fill the formula down you tap cell and then Fill:
    And drag the bottom part of the yellow rectangle down:
    Wayne's example would look similar.
    SG

  • How do you apply freight to a PO number on a second invoice?

    Some of our vendors will bill us later for freight from a PO.  How do you apply this to a PO number?  The only way I can see this happen is if you create a change order and add the freight to a line on the PO.  Any ideas would be appreciated.  

    Sampleconstruct wrote:
    .... or you can use Soundtrack Pro (export your file to SP with command shift+w) which comes with Logic Studio as an external Audio editor, do all the Plug rendering in there and bring the file back into Logic which works great for me.
    I tried to find the thread we had going on here about this very thing, but couldn't find it (it probably got deleted, because it was informative...)
    But opening Soundtrack Pro from Logic is THE way to do this. If I had known how easy this was, I would've been doing this months ago.
    Just this week, mixing a song, and there was a serious plosive on a word on the lead vocal rack. I hit shift/W, and the vocal file opened in Soundtrack Pro. I highlighted the plosive, applied a low cut from the channel EQ, flattened it, and quit STP.
    The vocal file in Logic immediately updated, and it was done. The EQ was applied permanently to that one section of the vocal file, and I didn't have to automate anything, or export anything.
    It took less than a minute. Seriously... this is the way to handle destructive edits to audio. It's VERY easy to do.

  • How do you make mobile numbers the default number used in your contacts for sending text?

    How do you make mobile numbers the default number used in your contacts for sending text?

    Go to your contacts, find the contact that you wish to text, hit 'edit', and move that contact's numbers around until the mobile number is at the top. Arduous I know, but it works. Now when you go to text that person, the mobile number should be the default.
    Best.

  • How do you retain "restore previous session" in your browser

    Hi there
    why does RESTORE PREVIOUS SESSION not work after a few sessions?
    I use Firefox twice per day and each time I boot up my PC (WIndows 7), it prompts me to restore my previous session. I realised after a few of these boot-up sessions, it DOES NOT allow me to restore my previous session. Going to History, the tab "restore previous session" is unclickable too.
    How does one RETAIN restore previous session PERMANENTLY? I'm using Firefox 24.0
    Kindly advise me.
    Thanks
    Joseph
    [email protected]

    And then after opening Firefox, and then what? If you're trying to help it'd be appreciative you are clear and complete with your instructions.
    Thanks!

Maybe you are looking for