Separate the int and decimal parts of a double var

Hi,
I would like to know how can I obtain the int part and decimal of a double var.
Example:
2.3455
int -->2
decimal--->3455
Also I would like to know how I can specify the precision of the decimal part. For example: 3455 if want a 2 decimal precision--> 34
Regards and thanks with anticipation.

Hi all,
I too have a way to this solve this.
1. Convert the double into a string.
2. Split it by . symbol, which will produce an array of two elements.( First one is integer part, another one is decimal part)
3. Now we can easily do type casting and get two variables.
Example:
double base = 2.5689;
String str = Double.toString(base);
String[] out = null;
out = str.split(".");
int a = Integer.parseInt(out[0]);
double b = Double.parseDouble(out[1]);Thanks
Ram

Similar Messages

  • How to separate the value and currency

    Hi Experts,
    We have data in report like this 12545EUR
                                                       24521DM
    Now our requirement is  separate the value and currency.
    Can anybody tell me what i do in Query designer.
    Thanks in Advance

    Hi
    NODIM is used in a scenario like u want find the amount of product then the formula for the amount is price * quantity
    AMOUNT = PRICE * QUANTITY
    IN this case the unit for PRICE ,let say EUR and for quantity the unit is EA and say we have price value = 10 EUR and quantity value   = 5 EA
    if u apply the above value in the above formula , then it leads to the value as shown below,
    AMOUNT = 10 EUR * 5 EA = 50 EUR EA
    In this case the units for the amount should be EUR not "EUR EA" in this case we have to eliminate the units for PRICE . so that can be done by using the
    amount = /BIC/NI_AMT * NODIM(/BIC/NI_QTY)
                 = 10 EUR       *   5         = 50 EUR
    Hope u got it,
    Revert back in case of any query ,
    Assign points ,
    Thanx & Regads,
    raviChandra

  • How to separate the source and the measured current

    Hi Everybody,
    I'd like to know if there is some way to separate the source and the measured current and just writte an mathematical expression to make a dependence between the source and the said parameter. Thanks in advance.

    Sure,
    Here is the deal:
    I'd like to build a circuit with dependent sources, but instead of connecting the sense of current/voltage, I'd like to know if there is a way to writte a sentence for the source which is dependent of a parameter.
    For example:
    In this circuit I just wrote an expression for the source and its respective parameter. (8*Io).
    Attachments:
    images.jpg ‏7 KB

  • After being prompted to download the latest software my iPad froze when it got to the Terms and conditions part.  It's now totally frozen, any suggestions?

    After being prompted to download the latest software my iPad froze when it got to the Terms and conditions part.  It's now totally frozen, any suggestions?

    Reset iPad and start all over again.
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    Note: Data will not be affected.

  • I need the decimal part of a double...

    ...but I can't find a 'method' in the api to do this. Is there one?
    I would rather avoid writing one myself.
    Also, how can I set the precision of a float? I glanced at BigInteger but it seems to be for output only.
    Thanks,
    Jeff

    what if I need to compare the thousands place ofthe
    decimal part?Then you can either do it arithmetically, similar to
    what itchyscratchy showed, or you can format it as a
    string and compare the third character to the left of
    the decimal.Oops. Fourth character.

  • Flat file having multiple header lines , how to separate the same and pushit into my intrnal table

    Hi Guys,
                    I got an issue , My flat file having multiple header lines
    TPS27RPR  MOME                                      THRIFT (SAVING) PLAN SYSTEM                                           Page    2
    09:54 05 JAN 2014                          List of Contributors w/Company Contributions                           Phase DAY Unit TRE
    Company No: xxxxxxxx - xxxxxxxxxxxxx.
                                                                            Employee/       Employee/
    Employee Full Name/                                                       Company         Company                        Allocation
    Number  ID Number                           PS  PN  End Date        Contribution          Profit        Total Balance   Percentage
    some lines of data and again
    TPS27RPR  MOME                                      THRIFT (SAVING) PLAN SYSTEM                                           Page    2
    09:54 05 JAN 2014                          List of Contributors w/Company Contributions                           Phase DAY Unit TRE
    Company No: xxxxxxxx - xxxxxxxxxxxxx.
                                                                            Employee/       Employee/
    Employee Full Name/                                                       Company         Company                        Allocation
    Number  ID Number                           PS  PN  End Date        Contribution          Profit        Total Balance   Percentage
    in this case how could I separate the header lines from the flat file and update the details to my internal table.
    kindly help me on this issue.
    Thanks and regards,
    M.S.Amirtharajvijay.

    Hi Amirthraj,
    If the flat file is static (if the content within it is same for all) then use the offset concept. First get the contents of the flat file into an internal table and later find the field that has to be in final internal table within the line, calculate the offset for the line and get the value into an workarea. Finally modify/append the work area into an internal table. Also wait for other experts answers for any other hassle free way to achieve the requirement.
    With Regards,
    Giriesh M

  • When i use arabic font with the build from the inspector the lower and uper part of the word is gone  ??

    my keynote 09 version 5.3
    i am using the arabic font albayan the problem is that when i use the build tool in the inspector the uper and the lower part of the word is gone i tryed to make the font smaller or adjust the position and that did not change so is there any way to fix this please because we can not use the build and the inspector tool like that ???!!!!!

    All iWork apps have bugs like this that make them generally unsuitable for RTL scripts like Arabic.  All you can do is try a different font and see if the results are any better.  Or try another app like OpenOffice or PowerPoint.
    Let Apple know this needs to be fixed via
    http://www.apple.com/feedback

  • I get silent audio after i separate the video and audio

    I'm using vintage video that I downloaded from the Internet.  in one project I separated the audio and video, ditched the audio, and exported, via share, the visual clips I need for my final video.  in a new project, I imported the segments to place over the audio I created with music software.  the segments have a silent audio, that is, it has a part that goes on the audio track, but it's silent.  it covers my audio and I can't hear it.  I don't know why this happens or how to avoid it.  help!
    Thanks,
    Rosateresa

    Rosateresa
    What version of Premiere Elements are you using and on what computer operating system is it running? Are you working with sources that come with copyright? For now I will assume no copyright protection involved.
    I understand what you are doing through the point that you get rid of the original audio of a video file that has audio linked to it.
    And, further I understand that you bring just that export video portion into a new project which has your "audio ...created with music software".
    But after that I need clarification.
    1. I would expect that, in the new project, you import the video to Video 1 to relate to the music that is already on Audio 1 or the Soundtrack.
    I lose you when you write
    the segments have a silent audio, that is, it has a part that goes on the audio track, but it's silent. it covers my audio and I can't hear it.
    2. I am wondering if you are really saying that when you export the video portion of your file, the export has a video and audio component (silent audio component)? If that is the case, in the export settings under the Advanced Button of the export preset selected, place a check mark only next to Export Video. Remove the check mark next to Export Audio.
    See example below from Premiere Elements 12 Windows. On the left...Export Settings and the Export Video and Export Audio boxes for check mark as needed. In the example I have a check mark only next to "Export Video".
    3. But you can do everything in the same project, I would think. Right click the video with its linked audio, select Delete Audio. And then import your music into
    that same project.
    ATR

  • How can I separate the "Icons and Text" of the browser control buttons (Back, Forward, etc.) from the Icons on the Add-on toolbar?

    At home, this is not an issue. I don't know why it's different here at work--same installation, same settings (as far as I can tell).
    Windows Vista
    Firefox 7.0.1
    Status-4-Evar installed to turn add-on bar into a status bar
    I have a NoScript add-on icon in the corner, which works fine. If I add a GreaseMonkey icon from the Customize menu, the "Icon and Text" appears for that icon, like the Icon and Text from the browser controls (Home, stop, etc). Other add-on icons also show Icon and Text (S4E, for instance). NoScript is the only one I've found so far which collapses down to just an Icon.
    This leads to the status (add-on) bar having a much larger height than I like. Essentially what I want is for only the Icon to appear in the Status bar (Add-on toolbar), while keeping Icons and Text in the Browser controls. My current workaround is simply removing the other add-on icons from the status (add-on) toolbar, but that takes away the ease of toggling and setting options.
    Please tell me if I can provide you with anything else, and thanks for your help.
    Edit: I've got some screenshots to show what I mean.
    [http://i41.tinypic.com/ftek9s.jpg desired behavior]
    [http://i43.tinypic.com/1z6a4h3.jpg problem when icon is added]

    Surely there must be some UserChrome.css that will solve this problem. Something like this:
    /* Remove text titles for icons in add-on bar */
    addonbar .button-text {
    visibility: collapse !important;
    Unfortunately that does not work. I probably have the button text item name wrong (there is a pound sign before addonbar but it doesn't show in this posting).

  • Is there a 3.5mm plug cable to separate the audio and mic?

    Then I can use is by the Ordinary headset

    well I'm actually the Ryan who's email is xxxx'd out. Guess they don't like showing people a way to save a few dollars on some car mounts for their ipod. Yet another reason why I don't have an ipod. Cripple the players and cripple the forums. Though I still bought my mom an ipod
    Anyway...after poking around, wouldn't an easy solution be to just buy the AV Composite cable, use the stereo RCA plugs for the input on the in dash radio (can buy a $3 RCA to 3.5mm adapter if needed) and use the USB side to charge via a USB car charger? Granted, it's not the nice hardwired solution (my prefrence), but for most who just want plug and play, it's a simple solution for line out sound quality and charging while in the car.
    The only downside is I don't see a cheap one anywhere. You'd think some third party company would've made one by now. They make everything else cheaper. But the cable would serve double duty if you needed it elsewhere. PLUS, if you had an indash LCD screen, you could use the video out on it as well. Screw the DVD player, just use your ipod video/touch/iphone as the video player in your car. Some indash players have video in as well.
    Regardless, you have options to get line out sound quality. If you don't need to charge, docking port av cables are about $6 on ebay. Just do a search of "ipod av composite cable". It'll come up along with the headphone jack ones.
    Another plus going the USB route is why not go that route with everything you have. You can hard wire in a usb hub, have it hidden behind the dash and just run a usb cable for your particular device to it. Much smaller than 12v outlets and you can charge as many cables you can fit into the hub. Almost everything has a USB cable for it nowadays.

  • How do I remove the background display in the upper and lower parts of the page?

    The upper and lower ends have a background display when a new version was updated.I wish to remove the display.
    == This happened ==
    Every time Firefox opened
    == Today

    Sounds that you installed a Persona.
    You can uninstall that Persona and revert to the ''Default'' theme (Tools > Add-ons > Themes).
    See [[Using themes with Firefox]] and http://kb.mozillazine.org/Themes (Lightweight theme)

  • Dynamically Find out the Integer and Decimal Data Type of a Column

    Table: test (INTE number, DECI number(7,2))
    Try to dynamically determine the column type.
    Using select data_type from user_tab_columns. It only returns NUMBER which does not indicate if the column is an integer or decimal data type.
    Is there a way to dynamically determine if a column is integer or decimal type?
    Thanks

    First of all your column INTE stores not just integers but any franctional numbers too:
    SQL> create table test(INTE number, DECI number(7,2))
      2  /
    Table created.
    SQL> insert
      2    into test
      3    values(
      4           10.99,
      5           10.99
      6          )
      7  /
    1 row created.
    SQL> select  *
      2    from  test
      3  /
          INTE       DECI
         10.99      10.99
    SQL>If you want to declare column as integer you use either NUMBER(n) or INTEGER. And, as others already pointed out, you can check DATA_PRECISION & DATA_SCALE in data dictionary view USER/ALL/DBA_TAB_COLUMNS.
    SY.

  • 3 people have been using the same Apple ID for years.  How do we separate the information and create our own Apple IDs?

    Brand new to the community.    I'm confused as to how all of this works, but since we're using the same Apple ID, we seem to be getting eachother's information synced to our phones including contacts, music, etc.  I'd like to separate our accounts, but how do we retain the appropriate information for each individual?

    On person can keep the current account and the other two can migrate their devices to new accounts.  To migrate a device to a new accoun, start by saving any photo stream photos that you want to keep to your camera roll (unless already there) by opening your my photo stream album, tapping Select, tapping the photos, tap the share icon (box with upward facing arrow), then tapping Save to Camera Roll.  If you are syncing notes with iCloud that you want to keep, you'll need to open each of your notes and email them to yourself so you can later copy and paste the text into new notes created in your new account.  Then go to Settings>iCloud, tap Delete Account (which only deletes it from this device, not from iCloud; the person keeping the current account will not be effected by this), provide the password to turn off Find My iDevice and choose Keep on My iDevice when prompted .  Then sign back in with a different Apple ID to create your new account and choose Merge to upload your data.  If the same person has other devices to migrate to this new account, on the other devices they can save the photo stream photos to the camera roll, delete the iCloud account, choose Delete from My iDevice (since the data is already in the new account), the sign into the new account.
    Once you are all on separate accounts, you can go to icloud.com and delete any data that you don't want in your accounts (such as other people's contacts).
    If you're getting each other's music it may be because you have automatic download turned on, which automatically downloads purchases made any other device signed into the same iTunes ID.  To prevent this, go to Settings>iTunes & App Store and turn Music off under Automatic Downloads.

  • Admin training for WebLogic Server - just the Forms and Reports parts

    We will be upgrading our Forms & Reports application from 10gR2 to 11g. Our customers (well their DBAs) will need to install and manage WebLogic Server. So I'm looking for a training course where they can learn how to do that. The WebLogic Server admin course is 5 days, and another 4 for Advanced System Admin, which seems a lot as they are only going to use the parts required for Forms and Reports.
    I have read through the tutorial Using Oracle Enterprise Manager to Administer Forms Services. Is this the extent of what they need to know, or is there another chunk of the iceberg under the water? Can you recommend a training course please.

    Hi,
    After installing forms, the installer itself configures the WLS with the domains etc and also deploys the forms. Once after this, it is similar to that of 10g Application Server. All the maintenance of the forms is done using Enterprise Manager (EM Console). So, the section you mentioned should suffice.
    -Arun

  • My touch screen on my iPhone is not working correctly. I touch one part of the screen and another part responds. Is the there any way to solve this problem?

    My touch screen screen is not working properly.  I touch one App or icon and an different App/icon opens.  It is an ultra sensitive touch screen, any idea on how to solve this issue?

    Yes!  Stop using the charger!  My husband noticed it was worse when plugged in. One apple guy told me "restore" ... I did all that and it did not help. After I stopped using the charger, it stopped messing up. I used my husband's charger and all is well. 
    Later, an apple employee told me to bring in the charger for a trade in, because they had a recall on some of them.
    I haven't traded it yet, but I plan on it.
    Good luck!  Let me know!

Maybe you are looking for

  • Problem with animation and separate CPU intensive thread.

    Hi All, I'm in the process of writing a Java chess game with a computer AI. I've got everything working except for the animation of the computer making its move. Sometimes it works, sometimes it doesnt. Here's the problem: After the computer has fini

  • Can't Locate Rendered Files

    Premiere Pro CC Macbook. I am around 2 minutes deep into a well polished project, When i opened the project, my latest rendered images weren't there. The entire project was still fully rendered but seemed to be a much earlier save than my last save.

  • Unknown error in itunes - please help!

    I am experiencing problems synicing my ipod touch with itunes. When I plug in my ipod and click sync it loads for a while and then comes up with a message saying "An unkown error has occurred (-69)" Can anyone please tell me what this means and how t

  • Summing on the latest record with MDX

    I'm trying use MDX to sum up the most recent [Employee Compensation].[Employee Scheduled Hours] member for each [Employee].[Employee] but in the context of the the current query. Employee Compensation is a type II dimension, and an Employee can chang

  • SDVFX002 : Exit_saplv60b_002 Link between SD and FI documents

    Hi All, I want to know whether I can use this exit for changing the Payment Block Key to 'blank' in case of Credit Memos. As of now, the Payment Block Key is put as 'A' by SAP for this situation. Please let me know if I can use enhancement 'SDVFX002'