How can we specify the number of decimals to be printed

How can we specify the number of decimals to be printed
such as "%5.2d" in C.
Can anyone help me

You could use the DecimalFormat or NumberFormat to do the job.
double number 1234.567;
DecimalForamt df = new DecimalFormat("###.##");
String s = df.format(number);or
double number 1234.567;
NumberFormat nf = NumberFormat.getNumberInstance();
nf.setMaximumFractionDigits(2);
/* if needed.
   nf.setMaximumIntegerDigits(value);
   nf.setMinimumFractionDigits(value);
   nf.setMinimumIntegerDigits(value); */
String s = nf.format(number);I didn't test the codes but they should work. For more information, please consult the documentations.

Similar Messages

  • How can I specify the number of bins?

    I am using DM4J to create an OCluster model build component and am utilizing the autobinning capability. I would like to specify for each field the number of bins in which I would like the data segmented. How would I go about accomplishing this task?
    Thanks,
    Dianna

    The ability to set specific number of bins or even custom bin definitions for each attribute is only supported through the ODM API at this point.
    Look at the ODM java doc that was installed in your JDev\lib\ext directory and check out the oracle.dmt.odm.transformation package. You can also look at the ODM Sample code which has sample code that creates the binning specification then applies it to data. The sample code is available in the database Oracle Home directory.

  • How can we specify the Mailbox for Notes?

    In Mail.app, how can we specify the Mailbox for Notes (where the new notes will be resided)? It is now 'On My Mac'. I wish to change to my IMAP Mailbox so it sync with my iPhone by just checking email (not by syncing on iTunes).
    Thanks in advance.
    Message was edited by: Ekapon

    You could use the DecimalFormat or NumberFormat to do the job.
    double number 1234.567;
    DecimalForamt df = new DecimalFormat("###.##");
    String s = df.format(number);or
    double number 1234.567;
    NumberFormat nf = NumberFormat.getNumberInstance();
    nf.setMaximumFractionDigits(2);
    /* if needed.
       nf.setMaximumIntegerDigits(value);
       nf.setMinimumFractionDigits(value);
       nf.setMinimumIntegerDigits(value); */
    String s = nf.format(number);I didn't test the codes but they should work. For more information, please consult the documentations.

  • How can I limit the number of emails retained on my ipad air?

    How can I limit the number of emails that are retained on my iPad Air?  Because of legal requirements of a long-term project, I cannot permanently delete emails relating to that project from my ISP's mail server.  My gmail account contains over 17,000 emails and, upon setting up my new iPad, and updating to ios 7.1.1, I now have all 17,000+ emails taking up space.  I would like to limit the emails by count as I was able to do on my old iPad running ios 5.1.1 OR to retain them based on date range.  I have not found any instructions on the support discussions or general iPad blogs that allow me to do that.  Any way around this problem?
    I also miss the 5.1.1 mail search feature that allowed me to narrow the search by from/to/subject/all.  Does anyone know if that feature is available using some little-known ios 7.1.1 feature?
    Thanks for your help.

    jlfcba wrote:
    IOS 7.1.1 doesn't show a "days to sync" parameter anywhere in SETTINGS/Mail,Contacts,Calendars/ACCOUNTS/GMAIL Account/ GMAIL Acccount Info.  There is nothing in iTunes relating to such an option either.  So, it seems I'm back to square one.
    If you have a decent mail provider like Microsoft Hotmail or Outlook.com mail it does.
    If you have Gmail it does not.  Quite right. Gmail is rubbish.

  • HT2729 I have limited space on my new ipad. How can I limit the number of songs from my itunes on my imac from going to my ipad when I connect the two?

    I have limited space on my new ipad. How can I limit the number of songs from my itunes on my imac from going to my ipad when I connect the two?

    you can do this by keeping the external hard drive connected and doing the following
    -hold shift key down on computer while opening iTunes and a prompt will appear to choose a library
    -select choose library, iTunes should bring up your explorer windows where you can search for the external HD
    -after you find the external HD find the iTunes folder you just copied to it
    -after opening the iTunes folder look for the file that says iTunes library.itl or if you can't see that extenstion just look for a document looking thing in the iTunes folder that shows up as a database file
    -double click the database file and boom iTunes should load your library without having to copy it to the computer
    PS: do make sure that if you are going to do it this way, make sure that the external HD is connected at all times, because if you don't then you will get exclamation marks next to your iTunes songs
    double PS: if you are unsure how to find out if the iTunes library file is a database file just right click it and choose properties and under the type it should say database file
    hope this helps:)

  • Hi, how can I limit the number of emails I can see on my iPhone 5. Every time in delete one and older email gets added from my live.co.uk account (where I want to keep my 2500 emails) I just don't want many on my phone. Thanks

    Hi, how can I limit the number of emails I can see on my iPhone 5. Every time in delete one and older email gets added from my live.co.uk account (where I want to keep my 2500 emails) I just don't want many on my phone. Thanks

    You can't. Why on earth would you attempt to manage 2500 emails with setting up a folder structure or some means of doing so? Simply keeping them in an single inbox is not realistic, no matter what email client you use.

  • How can I reset the number authorized Macs in my account?

    How can I reset the number authorized Macs in my account? Two old Macs that I no longer have are still authorized, which leaves me with three working macs at home.

    Hello Joe
    You will find your answer on this page. In summary you have to deauthorize each of the 2 Macs on the Mac thenself. If it's no longer possible, then you have to deauthorize all five Macs and then reauthorize each 3 remaining
    http://support.apple.com/kb/HT1420
    Bye

  • How can I specify the default tab in a CHM Output?

    My company uses CHM-based help for some of its products. We build the CHM files from RoboHelp 9, and while these CHM files don't really have a full Index attached to them, the Index tab shows up in the output anyway. Unfortunately, we are suddenly seeing that when the CHM file is launched from our program, the Index tab is displayed by default. We'd rather have the Contents tab be the default look, especially considering that the Index does not exist.
    I have poked around into how you can specify a default tab for a CHM file, and the only information I have found suggests that using a CHM file creates a file (HH.dat) that specifies which tab should be displayed on a user-by-user basis, and that the last tab displayed when you close the CHM should be the first one displayed when you re-open it. While this is true if you open the CHM independent from the product, when you launch it from our program, it's all Index, all the time.
    So, my question is: How can I specify the default tab for a CHM file? Or, failing that, how can I excise the Index tab from my CHM output.

    Hi there
    This will be something up to your application developer to resolve. When s/he issues the call to open the CHM, there are parameters that may be used to always open with the desired tab "in front".
    Point your developer to the link below and advise that s/he is most likely interested in the section titled: Programming Tips.
    Click here to view
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7, 8 or 9 within the day!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • How can I increase the number of R3trans in the SHADOW_IMPORT_INC ?

    Hello ,
    we have a problem with ehp installation .  The Prepare Phase for EHP4  have we start on monday . But we have closed development on Thursday and now the SHADOW_IMPORT_INC is to slow.
    How can I increase the number of R3trans in SHADOW_IMPORT__INC Phase ? We have opened a servicecall with prio high but sap does not answer.
    Regards

    Hi Daniel,
    What database are you working on ?? Make sure stats are updated. This phase has lot to do on the DB part. So analyse more from DB perspective.
    Most important thing is check if you are using parallel import property of R3trans as per SAPnote # 1127194.
    Best Regards
    Niraj
    Edited by: Niraj Kumar Soni on May 1, 2010 12:50 AM

  • How can I limit the number of rows returned by a select stat

    How can I limit the number of rows returned by a select
    statement. I have a query where I return the number of stores
    that are located in a given area.. I only want to return the
    first twenty-five stores. In some instances there may be over
    200 stores in a given location.
    I know is SQL 7 that I can set the pagesize to be 25....
    Anything similiar in Oracle 8i?
    null

    Debbie (guest) wrote:
    : Chad Nale (guest) wrote:
    : : How can I limit the number of rows returned by a select
    : : statement. I have a query where I return the number of
    : stores
    : : that are located in a given area.. I only want to return the
    : : first twenty-five stores. In some instances there may be
    : over
    : : 200 stores in a given location.
    : : I know is SQL 7 that I can set the pagesize to be 25....
    : : Anything similiar in Oracle 8i?
    : If you are in Sql*Plus, you could add the statement
    : WHERE rownum <= 25
    : Used together with an appropriate ORDER BY you
    : could get the first 25 stores.
    Watch out. ROWNUM is run before ORDER BY so this would only
    order the 25 selected
    null

  • How can  i  display the Number  instead of  E

    Hello Everyone ;
    I am getting confused. How can i display the Number but the Exponential value is coming as E.
    SQL> select sum(amount_sold) from sales;
    SUM(AMOUNT_SOLD)
    1.1287E+11
    Table details ..
    SQL> desc sales
    Name                                          Null?        Type
    AMOUNT_SOLD NUMBER
    i want to change 1.1287E+11 to "numeric"
    DB : 10.2.0.4
    os : rhel 5.1

    Just a minor correction on an obvious math/responding too fast error: 1.1287E+11 is a 12 digit number. You move the decimal 11 positions to the right which would add 7 zeroes to the value.
    MPOWEL01> l
      1  select length(to_char(1.1287E+11)), to_char(1.1287E+11,'999,999,999,999'), 1.1287E+11 "TEST"
      2* from sys.dual
    MPOWEL01> col TEST format 999999999999
    MPOWEL01> /
    LENGTH(TO_CHAR(1.1287E+11)) TO_CHAR(1.1287E+          TEST
                             12  112,870,000,000  112870000000the problem was that the OP failed to alias the sum result to the formatted column rather than the lenght of the data.
    HTH -- Mark D Powell --

  • Facetime is using my husband's cell phone number instead of mine? How can I change the number in face time?

    Facetime is using my husband's cell phone number instead of mine. How can I change the number to mine in face time?

    You need to set up the accounts in System Preferences/Accounts, then activate Fast User Switching.
    That way you can quickly log in to your own account - then back to his.
    You should obviously have different passwords.

  • How can i know the number of lines in field-symbol internal table

    how can i know the number of lines in field-symbol internal table

    Hi,
    If your field symbol has been defined as an internal table :
    Use std describe as
    Data: l type i.
    describe <fs> lines l.
    'l' will contain the number of lines as needed.
    FYI
    The size of this storage area in a field symbols depends on the number of table lines which is not fixed, but determined dynamically at runtime.
    Regards,
    Amit

  • How can I view the number of tunes in the Library? The number shows for Playlists but not for the total Library.

    How can I view the number of tunes in the Library? The number shows for Playlists but not for the total Library.

    Hello,
    I apologize for submitting this question.  Soon after I posted it I saw a similar question that had my answer..
    Again, my bad for not looking first.
    Ron Morris

  • I am trying to locate an email that I deleted and assume should be in the trash.  However my trash now only goes back a few days - how can I increase the number of days the trash remains accessible for

    I am trying to locate an email that I deleted and assume should be in the trash.  However my trash now only goes back a few days - how can I increase the number of days the trash remains accessible for.

    StevieJ wrote:
    I am trying to locate an email that I deleted and assume should be in the trash.  However my trash now only goes back a few days - how can I increase the number of days the trash remains accessible for.
    Check Mail Preferences, Accounts tab. Select the account, then the Mailbox Behaviors tab. See if you have it set to Permanently erase deleted messages when: One week old. (or less)

Maybe you are looking for

  • No internet access since updating to ios 8

    Since updating my ipad air to ios 8.02, I can not use internet.  I get mail but sometimes the message is blank because of lack of internet.  I have also been able to use facetime.  I can not check for software update in settings.  I used itunes on my

  • Processing Binary files with Mapping NOT (always) possible ??

    Hello All, I need your help solving this strange behaviour of XI. I am developing a (image)file to (image)file interface with a simple mapping but XI is giving unpredictable results. Processing the same inputfile e.g. 10 times after each other: resul

  • Xml message from XI to Siebel issue

    Hi all, I have an issue and I would need some help. My scenario is R/3->BAPI->XI->Siebel and the communication channel between XI and Siebel it obviously http based. The thing is that for some reason, Siebel it's not receiving the xml message XI send

  • Error ORA-28009: connection as SYS should be as SYSDBA or SYSOPER

    hi, i try to connect to oracle in c#2005. I'm using oralce 10.2.0.3.0 in window vista. i can connect as user scott , but can't do the same thing with use sys like sysdba. i encouter error : "ORA-28009: connection as SYS should be as SYSDBA or SYSOPER

  • Vista - gaming lag after creating a static ip

    Using a W54G but my problem is with my wired computer Recently I have had friends not being able to find the server I create for a game we play called Rainbow Six Vegas. For what it's worth these same friends were connecting a week ago when it was un