Problem with Float.toString

Hi,
I have a small problem with wrapper class Float.
For example
float f = 99999999999999999f;
f.toString(); returns a mentioned in the api doc: 9.9999999999999999E16
while I wanted the original 17 times a 9,
how can I achieve this??
THX

I tried to use the DecimalFormat class with the patter 17 * #, but the string it prints is no longer the same as in the original Float (17 * 9), now I get 17 chars but they are no all 9

Similar Messages

  • Problem with floated elements in IE5.5

    I've apparently got a problem with a right sidebar float
    being dropped in a primitive version of IE and I can't figure out a
    remedy, as none are suggested in dwcs3's browser compatibility
    function. The site is lindafarronknapp.com... if anyone has any
    suggestions I would more than appreciate it...

    Thank you for the replies. What was happening is that the other audio files were being onverted by PPPro. This one was not. I moved the file to the desktop and once again placed it into the project. This time the yellow conversion line on the bottom right corner went to work and it works fine. It was some type of glitch with that one file. Thanks again. Roman

  • Smart Forms : problem with Float Variable

    Hi  Expert,
       I have a probelm with Float variable. In my smart forms one fields of table QAMV contain value like 8.0000000000000000E+01.
    I have to remove the exponent and display value like 80.
    I have tried wa_qamv-sollwert(E10.4).. but it not working.
    Can U suggest me some solution.
    Regards
    Swati.
    Edited by: Swati Namdev on Apr 27, 2010 12:19 PM

    Hi,
    Please follow the steps.
    1. In your smart form create a variable w_val ,, type,, associate type -->  CHAR10
    2. Now write a code, jsut above your node where u wud like to get this value... For this Create -> Flow Logic -> Program Lines.. Now you have editor..
    3. In input parameters , put i_tab-QAMV.. and in output parameter put w_val... and Code like below
    CALL FUNCTION 'MD_CONV_QUANTITY_FLOAT_TO_PACK'
      EXPORTING
        iv_menge       = i_tab-qamv
      IMPORTING
        EV_MENGE       = w_val.
    4. Now grag and drop this w_val from global data field list...your this w_val will have the rounded value.. Pls try this and check..   It will work.
    Regards,
    Lokesh.
    Edited by: Lokesh Tarey on Apr 27, 2010 9:28 AM

  • Important Problem with floating toolbar !

    Hi all!
    I developed a plug-in using Acrobat 8 SDK. When I start acrobat 9.0,
    click any floating toolbar on which all tool buttons have been expanded,acrobat 9 will exist,but acrobat 8 is OK. This situation only happens when floating toolbar has some expandable tool buttons and all buttons have been expanded, and acrobat 9.0 starts without openning a PDF.
    I debuged my plug-in, stack overflow happened in acrobat.exe!
    How to solve this problem? Thanks all!

    I would start by using the debugger to try to find where the crash is taking place. I wold ensure that all of my code is properly wrapped with DURING/HANDLER blocks.
    If you are still having problems, I'll submit a formal support request to Adobe Developer Support.

  • Precision problem with float

    Hi,
    I have class with an amount variable whose type is float. If a value like 999999.99 is set to this variable, when I try to display this in JSP, the precision is lost. It displays 1000000. But my requirement is to print 999999.99. Is there any to solve this problem? The constraint to this prioblem is I can't change the data type of this variable. (Actually this class is generated through Castor. The xsd type is float. I am not supposed to change the XSD).
    Please advise.

    There's nothing to be done about it if you can't change the data type. See for yourself:    System.out.println(999999.99F == 1000000F);  // yep, they are equalBlame the person who decided that you should use float.

  • Access db: problem with float numbers if access isn't installed

    hi all,
    i wrote a simple application to store/retrieve float values into/from an access db.
    i tried it on my computer (with ms access installed) and i could store float values (ie 136.5), but when i tried my application (copying all classes and the db) on another machine without ms-access, i couldn't store float values, only int (ie 1365.0).
    the column "price" in the db is set as float with 1 decimal number, and there are other columns set as string, with no problem.
    anyone could help me?
    should i install access into the second machine too?
    thanks
    sandro

    Could it have something to do that on one machine '.' is interpreted as a decimal point, but on the other machine it is interpreted as the , you use in e.g. 1,000 (=1000).
    I would check that both macines use the same Regional Settings (in the control panel).
    Do you use any of the java.text.xxxFormat classes?

  • 4.1.1 new theme cloudy 24 problem with javascript toString

    the following statement works fine for theme 21 but when I change the theme to new cloudy 24 it is giving error
    var origAction = $('button[value=Create]').attr('onclick').toString();
    Uncaught TypeError: Cannot call method 'toString' of undefined

    Hi pkpanda,
    I think the problem is that theme 24 is using the <a> tag to render buttons instead of using the <button> tag that's why you jQuery selector will not find anything.
    Which causes the "Cannot call method 'toString' of undefined", because toString is not a valid method for undefined.
    Change your selector to
    var origAction = $('#YOUR_BUTTON_STATIC_ID').attr('href').toString();and set the "Static ID" attribute of your button to a unique name within your page. First of all this will perform better and second it also has the advantage that if somebody changes the "label" of your button or code will not break.
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Problems with float

    hi,
    Im using float values to represent the price of products in a program. When a user selects a number of products to buy the total value of all the goods is shown, by adding all the float values together. the problem is that when i add all the floats i sometimes get a value greater than 2 signficant places:
    e.g.
    total = 23.34234
    when i really only want
    total = 23.34
    Is there any way of restricting the units shown after the decimal place or is there a better way to represent the price of the produts?

    is there a better way to represent the price of the produts?Yes, use an integral type (e.g. int) to represent the price in pence/cents/gopiks/whatever-is-your-smallest-unit. Binary floating point numbers only approximate most decimal numbers, so they will give you much grief. As a heavyweight alternative you might consider BigDecimal.
    Edna's suggestion is the correct way to format floating-point numbers for display.

  • Problem with Float - round down error

    I have to save in database (MySql) amount which is passed by user. For instance user writes 99999999999. But Float.parseFloat(request.getParameter("amoUnit")) returns value 9.9999998E10 . When I save this value in database I receive 99999998000.00. I want to have in database exactly what the user has written. Should I use differen data type? Thanks in advance.

    leonkaP wrote:
    ... I want to have in database exactly what the user has written. Should I use differen data type? Yes.
    If you want more precision than float, use double.
    If you want exact precision, use BigDecimal.

  • Problem with floating point numbers

    Hi Experts,
    I am accepting two float values thru a method :- amount and tenure.
    Now wat i want to do is
    target = amount / ( tenure * 12 );
    but result target is not what it supposed to be. For example:-
    if amount = Rs. 15 00 000.0 and tenure = 3 yrs, target amount should be 5 00 000. but it is coming 41666 sumthing.
    How should I code this?
    Pls help,
    regards,
    Amey

    Hi,
    I am accepting two float values thru a method :- amount and tenure.
    Now wat i want to do is
    target = amount / ( tenure * 12 );
    but result target is not what it supposed to be. For example:-
    if amount = Rs. 15 00 000.0 and tenure = 3 yrs, target amount should be 5 00 000. but it is coming 41666 sumthing.
    How should I code this?
    I dont see any error in calculation,
    15 00 000.0 / 36 is perfecctly 41666 sumthing
    how can you expect this to be 5 00 000?
    If you want that change your calculation from
    target = amount / tenure ;
    Regards
    Ayyapparaj

  • Problem with float type display

    I have a float number, after bigger than 1E8,
    it will display as 1E8.
    How can I make it to display at 10000000?
    Thanks

    Hi!
    You may use something like:
    import java.text.*;
    double f = 123456789.9876;
    NumberFormat nf = new DecimalFormat("####.####");
    System.out.println(nf.format(f));
    I believe it is a good idea to use double for such numbers, not float.

  • Problem with floating windows CS4

    Since CS4 I don't see a possibility to open all images separatly in floting windows. When I change it at the pull down menu it just does it with the recent pictures as soon as I open a new one (from the desktop) they are "stacked" again.
    There must be a possibility to change that in general.I do work with PS since 8, this seams to be new. Ay ideas ???
    THX

    UNcheck the "Open Documents as Tabs" setting Tab in Photoshop > Preferences > Interface > Panels and Documents >. I've never seen tabbed windows on my machine thanks to that. ;)

  • Stumped on basic problem with floating point math

    I can't figure this out!  It should be sooooo simple. 
    Here is the challenge: 
    I have an incoming time array.  For example:     0, 1, 2, 3, 4, 5, 6, 7, 8, 9
    I want to scale this array by a constant (e.g. multiply by 0.1).  So the resulting array should be:     0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9
    Then I want to calculate the difference between each and every subsequent element in the array.  In this example, the difference should 0.1 between every element.  But my comparison fails. 
    See the example below.  As far as I can see, the resulting boolean should always be TRUE.  But its not.
    But if I remove the scaling operation, then it works ok!
    Please help!
    Solved!
    Go to Solution.

    It has been awhile since smercurio has had a contribution to his retirement fund, but once again you have "discovered" that there is no exact binary representation for 0.1.
    I'd use one of the current "almost equals" comparisons described here:
    http://forums.ni.com/t5/LabVIEW/Darin-s-Weakly-Nugget-2-8-11/m-p/1444262
    And vote for this if you haven't already:
    http://forums.ni.com/t5/LabVIEW-Idea-Exchange/quot-Almost-Equal-quot-functions-for-Float-comparisons...

  • Problem with floating point precision

    Hello!
    I need to store in a variable a number like this 1234512345.123412345.
    But when I store it on a double or long double... it gets truncated to 1234512345.123412... only six decimals?
    What can I do??
    Thanks!

    If you are going to use the BigDecimal class, it is worth bearing in mind a tip that was passed on to me from georgemc. If you create the BigDecimal class instances using the constructor that accepts a String as input, then you can easily specify how many digits should follow the decimal point.

  • Problem with inheritance and outputting values in toString.

    Hey guys, i'm having a major problem with inheritances.
    What i'm trying to do with my program is to create objects in my demo class. Values are passed to several other objects that each do their own calculations of grades and results and then outputs the result in my toString. I followed step by step the instructions in my book on how to setup the inheritance and such. I can only output everything that was created in my superclass, any other thing that was created in an object that belongs to a subclass does not display in the output at all.
    Even if I change or create new instance variables, I can't figure out for the life of myself how to output the other values.
    Because there's so much code to be splitting on the forums, I zipped my whole project in a RAR. I'll link it here
    http://www.4shared.com/file/ZleBitzP/Assign7.html
    The file to run the program is CourseGradesDemo class, everything else is either a subclass or superclass to some part of the program. After you run CourseGradesDemo, you will see the output, and understand what displays and what stays at 0.0 value. If anyone can help me out with this it would be greatly appreciated
    Thanks in advance.

    Basshunter36 wrote:
    Hey guys, i'm having a major problem with inheritances.
    What i'm trying to do with my program is to create objects in my demo class. Values are passed to several other objects that each do their own calculations of grades and results and then outputs the result in my toString. I followed step by step the instructions in my book on how to setup the inheritance and such. I can only output everything that was created in my superclass, any other thing that was created in an object that belongs to a subclass does not display in the output at all.
    Even if I change or create new instance variables, I can't figure out for the life of myself how to output the other values.No idea what you're talking about. Provide an [url http://sscce.org]SSCCE.
    Because there's so much code to be splitting on the forums, I zipped my whole project in a RAR. I'll link it here
    http://www.4shared.com/file/ZleBitzP/Assign7.html
    Not gonna happen. Provide an [url http://sscce.org]SSCCE. And don't say you can't. You definitely can. You may have to spend an hour building a new program from scratch and getting it to reproduce the problem, but if you can't or won't do that, you'll find few people here willing to bother with it.

Maybe you are looking for

  • Apple put the wrong serial number on my replacement MBP invoice

    Hi all. In short - I purchased a MBP early 2011 which I needed to return for replacement 3 days later. This was done on the spot and a replacement invoice was to be emailed to me. I purchased AppleCare with my original MBP and I was told that this wo

  • PS CC 2014 Exiting Text Edit mode when changing to another application

    I just updated to PS CC 2014 on my iMac running Mac OS X Yosemite. I noticed that if I enter Text Edit mode on a text layer and then change over (CMD+Tab or ALT+Tab) to the word processing app (TextEdit or Word) that Text Edit mode will commit. In PS

  • What are EBS Database Username and Password

    Hi Freinds .........just installed EBS Successfully..............When i am using SQL PLus as "Conn / as sysdba" it is not connecting as similar to Oracle 9i/10G.............can u please Tell me what are The Default usernames and Passwords are ???] Th

  • Unexpected Error consistently in iMovie 11

    I have hundreds of events, as well as projects in iMovie. Most of them are located on an external WD drive. Everything works perfectly, as has for the past year. EXCEPT, whenever I try to manuever the contents of an event iMovie shuts down immediatel

  • Performance problem with GotoDate

    hi everyone! we're facing a performance issue when looking at historical data based on GotoDate(). The following points apply to our case: - the problem only appears for one specific table, it's not a global problem (at least we currently only found