Viewing only x number of digits for double or float

I was wondering if I had a float or a double, and lets say I didn't want to see all those decimal places, is there a way for me to limit the number of decimal places that is outputted to like 3 or 4 instead of 10? Thanks for the help.

oh...
you probably wanted to know how to, lol
go to:
http://forum.java.sun.com/thread.jsp?forum=31&thread=313399
cheers.

Similar Messages

  • Largest number of digits for NUMBER datatype?

    What is the largest length of a NUMBER that Oracle will "support"?
    The documentation says the following:
         Datatype Limits indicates:
             "Can be represented to full 38-digit precision"
         NUMBER Data Types indicates:
              "Oracle guarantees the portability of numbers with precision of up to 20 base-100 digits, which is equivalent to 39 or 40 decimal digits depending on the position of the decimal point."
    I realize if I define a column as simply NUMBER, I can insert numbers with a size up to 126 digits.  However, Oracle seems to only maintain the first 40 digits IN MOST cases.  The most number of digits it seems to allow is 40 before it starts to replace with 0's.
    With numbers that have more than 40 digits, Oracle will sometimes replace any numbers after the 38th digit with a 0 and other times will replace with 0 after the 39th or 40th digit.
    Therefore, what is the most number of digits we can have confidence in Oracle storing safely?
    This was the code I used for testing this process.
    create table max_num (num number);
    declare
      l_x number;
    begin
      for x in 1..200
      loop
        l_x := x;
        insert into max_num values (rpad(1, x, 1));
      end loop;
      exception
      when others then
        dbms_output.put_line('STOP: '||l_x);
        dbms_output.put_line(sqlerrm);
    end;
    select num, length(replace(num, 0)) from max_num;

    Hi,
    user109389 wrote:
    What is the largest length of a NUMBER that Oracle will "support"?
    The documentation says the following:
         Datatype Limits indicates:
             "Can be represented to full 38-digit precision"
         NUMBER Data Types indicates:
              "Oracle guarantees the portability of numbers with precision of up to 20 base-100 digits, which is equivalent to 39 or 40 decimal digits depending on the position of the decimal point."
    I realize if I define a column as simply NUMBER, I can insert numbers with a size up to 126 digits.  However, Oracle seems to only maintain the first 40 digits IN MOST cases.  The most number of digits it seems to allow is 40 before it starts to replace with 0's.
    With numbers that have more than 40 digits, Oracle will sometimes replace any numbers after the 38th digit with a 0 and other times will replace with 0 after the 39th or 40th digit.
    Therefore, what is the most number of digits we can have confidence in Oracle storing safely?...
    If the documentation says 38, then I'll say 38, too.
    If you put in a number greater than or equal to 1E39, then Oracle may round it to 38 significant digits; that is, the last digits you entered may get turned to 0's, or rounded up.

  • The BADI AND FM involved in mentioning the number of digits for Price

    Hi,
      Please mention me the name of BADI & Functional module(or if report program) involved in validating the number of digits entered for the field price while creating Shopping cart.
    i am eagerly waiting for the answer.
    regards,
    George.

    Hi. I would imagine it is the done via the data dictionary and is checked as a matter of course in every transaction like normal.
    Why do you want to know this? If you need to change number of decimals there are options available.
    Have a look at this thread:
    Re: decimal places for Price
    Regards,
    Dave.

  • CR2008 and SAP BW - Only limited number of values for static parameter

    Hello Experts,
    we have the following constellation / problem:
    - SAP Query BW 7.0 with variables
    - a report built upon this query with Crystal Reports 2008
    - now if we execute the report and try to fill in the parameters (= SAP BW variables), not all values are displayed for selection and there seems to be no possibility to further scroll down; e.g. the months 01.1993-08.2006 are displayed, but not later than 08.2006
    This is really a problem for us since the users won´t be able to select e.g. the desired time range !
    I read already the SAP notes 1218588 and 1211902 and I 'implemented' 1211902, but still only a few values are displayed (the same as before I changed the values for BrowseTimeout and MaxNBrowseValues). Besides that, in the solutions in the SAP notes Crystal Reports 2008 is not explicitly mentioned (so I manually created the DWORD-keys).
    Many thanks for your help in advance !
    Frank

    See
    CR2008 and SAP BW - Technical Values for variable values not displayable ?
    for the answer.

  • How to restrict a text field to accept limited number of digits (only) with leading zeroes

    I am trying to restrict a field for accepting only limited number of digits that can have zeroes in the begining - this why I can't use Numeric field. Can anybody help?

    Hi Niall,
    Thank you very much,
    I did something like what you told me - thought I used script in ordetr to prevent entering any chracters except digits.
    In Change event I enterd the following script:
    // Restrict input to digits only - Number of digits (characters) assigned in Object Palette - Field Tab
    if((xfa.event.change != 1) && (xfa.event.change != 2) && (xfa.event.change != "3") && (xfa.event.change != "4") && (xfa.event.change != "5") && (xfa.event.change != "6") && (xfa.event.change != "7") && (xfa.event.change != "8") && (xfa.event.change != "9") && (xfa.event.change != "0"))xfa.event.change
    = "";
    This does the job.
    Thank you,
    Peter.

  • Limit the number of Digits at destination pattern in As5350

    Hi
    I wanna configure an as5350 dial peers to accepts the exact number of digits for destination pattern like this :
    destination-pattern 00T
    now i want the client do not enter more than 10 digits for destination pattern like 3144003232 if they are enter more than ten they received an error from as5350.
    just limit the numbers of digits at destination pattern.
    Thanks.
    Best Regards B.Mozaffari

    Hi,
    use ^ and $ in your pattern. If you create
    destination pattern ^3144003232$
    it should work for you.

  • I need to view the photo number.

    Anybody can help, I need to know the photo number. How to view the photo number in iPhoto for iOS version.?

    Apple Support Contact
    Apple Support contact - Telephone

  • Maximum Digits for Extension in Callmanager 4.X

    What's the official maximum number of digits for extensions in CM 4.x? The error message says it's 24 and I got this information that it is supposed to support 32.

    I doubt this has changed much, if at all, from 4x.  If you look at the Data Dictionary for 7x, it provides the following:
    DN
    This field is a directory number. This is currently defined as a variable length string of max length 23.
    So, max length of 23. 
    Hailey
    Please rate helpful posts!

  • My iPad 2 only keeps a set number of emails for me to view eventually deleting from the screen. How do stop this as it syncs with my phone and mac book pro neither of which do this?

    My iPad 2 only keeps a set number of emails for me to view eventually deleting from the screen. How do stop this as it syncs with my phone and mac book pro neither of which do this?

    Thanks for that. Much more constructive than the last comment. It's only the restriction code I can't recall, not the access passcode. So I can currently access the device, just not age restricted content. Does that's make a difference? I also wondered if anyone knew how many attempts you get to try to get it right. Now tried 21 times and so far nothing bad has happened but I am concerned I'll eventually be completely locked out of the device. That doesn't seem in the spirit of things though. Surely it's foreseeable that a child could repeatedly try to guess the code so I can't see that it would be right to lock the device down completely in that circumstance, particularly if the access code is being typed in correctly every time.
    Thanks

  • Double with only 2 number after point

    hi,
    I have a double with a few number after the poin, I need have only 2 number after the point...
    in past I have asked in this forum and receive a good answer...
    NumberFormat formatter = new DecimalFormat("00.00");
    String Average=formatter.format(Media1);
    Now the problem is that Average is a String while I need a double, exists a way to return a double rather than a String...
    thanks in advance...

    hi,
    I have a double with a few number after the poin, I
    need have only 2 number after the point...
    in past I have asked in this forum and receive a good
    answer...
    NumberFormat formatter = new DecimalFormat("00.00");
    String Average=formatter.format(Media1);
    Now the problem is that Average is a String while I
    need a double, exists a way to return a double rather
    than a String...
    thanks in advance...You are confusing a double's value with its representation. The representation (as a string of characters - digits, decimal point, and more digits) is what shows 2 decimal places. That is what DecimalFormat is for.

  • How to view only select images out of a collection of digitized slides

    I have not yet purchased adobe photo software. Which version is the simplest to accomplish what I want to do and is it simple?  Or do I even need photo software.  I have digitized my 50 years of slides. They are in large folders on the computer. Each folder is labelled only with a time period. Each image was corrected via MS Photo Gallery and then tagged or labelled with who or what, where and when.
    How can I best send them out to the children to view on their computers but with  a way for them to select and view only the ones they are interested in out of the thousands. Like " Diana" or "Grand Canyon 2010".  We are 75 and not very computer literate yet. We have done this once now  and want to take the next step to make it a user friendly resource for our kids and grandchildren

    Certainly, Lightroom or Photoshop Elements will do this. As far as I know, the freeware Picasa should be able to do this as well. If you are not very computer literate, you probably would want to start with Picasa.
    If your needs are no more complicated than described above, you could also use your operating system to search for keywords. Of course, if you need other features from photo software, then your operating system isn't sufficient.

  • Bank Account number in IT0009 for Switzerland more than 18 digits

    Dear Experts,
             I encountered a problem when trying to create a bank account number in IT0009 for Switzerland. Because this Swtizerland bank account number is 21 digits which exceeded the current bank account number field length which is 18 digits only.
             Thanks.
    Regards,
    Yen

    Dear Ram Manohar,
              Thanks a lot for your reply. Before this I thought of putting the additional 3 digits in 'reference detail' field too. But the field 'reference detail' is not being showed at all when I change the bank key to 'CH' Switzerland.
              Please advice if there's any other way to store the additional 3 digits of bank account number?
              Thanks.
    Regards,
    Yen
    Edited by: Choy Hoon Yen on Apr 18, 2008 4:59 AM

  • SharePoint 2013 allows downloaded even for users with "view only" permissions

    I have a new on premises SharePoint 2013 server and assigned a single user "view only" rights to a document library. In the "permission levels" window, this permission is described as "Can view pages, list items,
    and documents. Document types with server-side file handlers can be viewed in the browser but not downloaded."
    Once I gave the user that permission, I noticed he was able to view documents in the library but the "but not downloaded" part does not seem to be working. The user can still download documents to his local desktop and SharePoint does not prevent
    it. The "download a copy" option appears and the user can use it.
    My goal is to make all documents in this library such that users can only view them in the browser and not download a local copy. How I do that?
    Thanks for your help.

    Not entirely positive :-) 
    However, you have no server-side handlers in place today without WAC installed, so that portion of the View Only permission wouldn't be applicable.
    Note that WAC must be installed on its own server and if your SharePoint server is extranet or public facing, it needs to have a valid, public SSL certificate. Also, WAC should always be run over SSL regardless if it is public facing or not as the token
    sent between the SharePoint server and WAC is the same as having a username and password for the user making the request.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • How can I install Dreamweaver CS5.5 using my serial number? I only see the trial download for CS6.

    My company bought CS5.5 Creative Suite, and one of my coworkers used our license for Dreamweaver on his computer. Now he has left the company, and I would like to install the license on my computer so I can use it from my station.
    When we installed the software on his computer, we simply downloaded the trial version and then entered our serial number. However, now I can only find the download for CS6, and putting my serial number in there for CS5.5 does not magically download that version for me, unfortunately.
    Does anyone know how I can install the license on my computer? I thought it would be allowed to have it on two computers, just only one computer would be able to access the software at a time. I just need to figure out how to install it...

    I talked to Adobe staff, and apparently I needed to use the Adobe licensing website, licensing.adobe.com. I'll need to talk to my IT department, who bought the software, to get the account information for the site, but I'm on the way to success!

  • In Lion, Word for Mac only prints last two digits of year

    In Snow Leopard, the automatic dates that auto fill in Word for Mac (08, 2011) worked fine...BUT since I 'upgraded' to Lion, (10.7.3) only the last two digits of the year will autofill, EVEN in full date mode...ie, SHOULD BE:
    February 21, 2012
    BUT auto filled as: February 21, 12
    I saw on a MS help site that it's ID'ed as a problem in Lion:
    From http://answers.microsoft.com/en-us/mac/forum/macoffice2008-macword/automatic-dat e-entry-doesnt-enter-entire-year/91793432-006b-4f6a-99fa-cf425266cb84
    This was the query:
    automatic date entry doesn't enter entire year
    Applies To: Office for Mac | Office 2008 for Mac | Word for Mac
    When I enter the weekday at the beginning of a sentence, the month, date and year are automatically filled in. However, instead of having the whole years, such as 2011, it only enters the last two digits, such as "11". This is new since an update a month or so ago. I would like to set it back to the original "Friday, November 04, 2011" if possible.
    Appreciate any help I can get.
    ANSWER:
    Its a bug in OSX.7 evidently MS has not rung up Apple and said hey get off your duff and fix this date issue.  If you can find a place to send bug report to Apple do so.
    So I checked the OSX Lion support site on apple.com and could not find an answer.
    Does anyone know how to fix or how to get Apple to fix?
    Thank you.

    It's a bug, but whether it's a bug for Apple to fix or for Microsoft to fix is unknown. The thread you post is unauthoritative, being only comments by other users who have no more idea as to where the bug really lies (unless an Apple engineer has confirmed a Lion bug, something I've not seen) as any other user does; no one in that thread works for or speaks for either Microsoft nor Apple.
    You can comment on the issue to Apple, if you wish:
    http://www.apple.com/feedback/macosx.html
    but whether it's something they can fix or whether it's Microsoft's problem I can't say.
    Regards.

Maybe you are looking for