I18N NumberFormat.format loses precision- Need Help.

I am using this code:
String testFormatStr ="123456789123456789.1279";
double number = Double.parseDouble(testFormatStr);
NumberFormat formatter = NumberFormat.getNumberInstance();
String formatNumberStr = formatter.format(number);
Input String to be formatted:->123456789123456789.1279
Double converted value:-> 1.23456789123456784E17
The Formatted Number :-> 123,456,789,123,456,784
The fractional digits are ignored and the last integer digit'9' also changes to '4' after formatting.
This mainly happens if total number of digits including the
integer and fractional part exceeds 16.
Am I missing anything here?Does NumberFormat handle Big Decimals?
How to handle this?
Thanks and Regards,
Sankar S

Crossposted (several times). Please reply at the following thread:
http://forum.java.sun.com/thread.jspa?threadID=689479

Similar Messages

  • 18N NumberFormat.format loses precision- need help

    I am using this code:
    String testFormatStr ="123456789123456789.1279";
    double number = Double.parseDouble(testFormatStr);
    NumberFormat formatter = NumberFormat.getNumberInstance();
    String formatNumberStr = formatter.format(number);
    Input String to be formatted:->123456789123456789.1279
    Double converted value:-> 1.23456789123456784E17
    The Formatted Number :-> 123,456,789,123,456,784
    The fractional digits are ignored and the last integer digit'9' also changes to '4' after formatting.
    This mainly happens if total number of digits including the
    integer and fractional part exceeds 16.
    Am I missing anything here?Does NumberFormat handle Big Decimals?
    How to handle this?
    Thanks and Regards,
    Sankar S

    Am I missing anything here?Basically, you're missing the fact that double numbers have about 16 or 17 digits or precision.
    Does NumberFormat handle Big Decimals?The documentation claims that it does.

  • I18N NumberFormat.format loses precision

    I am using this code:
    String testFormatStr ="123456789123456789.1279";
    double number = Double.parseDouble(testFormatStr);
    NumberFormat formatter = NumberFormat.getNumberInstance();
    String formatNumberStr = formatter.format(number);
    Input String to be formatted:->123456789123456789.1279
    Double converted value:-> 1.23456789123456784E17
    The Formatted Number :-> 123,456,789,123,456,784
    The fractional digits are ignored and the last integer digit'9' also changes to '4' after formatting.
    This mainly happens if total number of digits including the
    integer and fractional part exceeds 16.
    Am I missing anything here?Does NumberFormat handle Big Decimals?
    How to handle this?
    Thanks and Regards,
    Sankar S

    Crossposted. Please answer in the following thread:
    http://forum.java.sun.com/thread.jspa?threadID=689479

  • Problems with songs not syncing to iTouch 4g even when in AAC format- really really need help?

    I need answers really seriously pronto as I am going abroad in a few days with little access to any computer and none to mine.
    I downloaded some songs from iTunes a couple of days ago and then synced them to my iPod (which is manually synced due to my songs being split between computer accounts- long story ^^). The songs themselves synced, but they're full of static or just silence. One in particular you can hardly hear- once the song starts playing, it just becomes quieter and quieter, interspersed with plenty of static. The other songs on my iPod are absolutely fine, it doesn't appear to be a problem with the iPod or the computer. I've tried making AAC format versions of these songs (which are absolutely fine on iTunes, just suddenly damaged on my iPod) but they won't sync- I drag them over to my iPod's icon and nothing happens. It worked before with a song that was just silent. I really need some help, I am so frustrated! Thanks in advance for any answers.

    What are the performance Preferences?

  • Working with several video formats aspect ratios need help...

    Hi folks I have searched around quite a bit but I need more specific advice based my situation...I am editing a docu about Japanese biker gangs shot on several different SD cameras:
    MY FOOTAGE
    1.Sony Vx-2000 fitted with a  Century Optics 16:9 converter lens bayonet mounted
    2.Canon Xl2 shot in 16:9 mode
    But I also have:
    ARCHIVAL/ACQUIRED FOOTAGE
    1. Contributor's camera SD 4:3 aspect ratio
    2.Contributor's camera SD 16:9 aspect ratio
    3. Transferred from VHS into SD 4:3 aspect ratio
    I would like to standardize the aspect ratio for the project but I am getting confused as sometimes the footage shot on the sony (which should be true 16:9) appears elongated vertically at times.
    Are my settings off?
    Also, I have "title safe" wireframe on in the Canvas and the images all exceed the outer box. I don't have a TV so it's hard to check what (if anything) gets
    lost. I guees most TVs can handle 16:9 without letterboxing....
    Do I have to worry about that? Which box should I crop to if I letterbox? The out or inner? Or the outside of the screen? Should I just letterbox the whole project?
    BTW eventually I am planning on Uprezing the project to HD using Magic Bullet when outputting.
    The overall question is: Who has experience dealing with multiple aspect ratios in one timeline? Can you offer any advice on a work flow to output successfully?

    Sorry to butt in, haven't read the entire thread.
    Suggest you plan from the beginning to create one timeline but encode for two separate output formats.
    Standard procedure for bringing multiple formats is to convert them to a single format as they are ingested. Decide early what the timeline format will be and transcode everything to that codec before anything is brought into the timeline.
    When your project goesgolden, export a single self-contained movie and take that to Compressor to create release movies that will be played on Blu-ray, SD  DVD, online, or in Power Point, whatever you need.
    bogiesan
    Message was edited by: David Bogie Chq-1

  • Col:peopleResource format problem - really need help!

    Hi all
    We are currently using the 'who is who' at the moment for searching the our coimpanies user base which is workin well. However I have a formating issue with the property <u>'col:peopleResource'</u>. Basically it appears on two line when it is displays e.g.
    Current display:
    0 <u>Joe</u>
       <u>Blogs</u>
    Should display:
    0 <u>Joe Blogs</u>
    (the '0' is the Icon)
    I have look everywhere on how to change this but I have had no joy. Any help would be great as this is slowly becomming an urgent problem!
    Thanks
    Phil

    Hi Phil
    From your description its very hard to say whats wrong, but here is my initial thoughts:
    Have you defined the with of the second column somewhere, like in the collection renderer?
    Are you displaying first and last name seperately or are you using displayname(contentlink) in the collection renderer?
    Whenever the layout messes up, it is a good idea to take a look at the html-code the error-prone page generates as it will contain some information about why the information is displayed like it is.
    Kind regards,
    Martin

  • Loser who needs help!

    are all 30 GB ipods 5th generation?

    I need some advice about my fifth generation ipod. Apple isn't any help at all. My ipod has 40GB, or at least it is supposed to. It is supposed to hold 10,000 songs, but it won't even hold 1,000. It's used, I bought it pre-owned because I could get more GB for less money. So, not only does it not hold 10,000 songs, but it also has a very dirty short story in the notes section that I cannot figure out how to get off. The story is more than just dirty, but when I type in what it really is the apple content checker bleeps it out. Please help, anyone. My email is [email protected]
      Windows XP  
      Windows XP  
      Windows XP  

  • Formatted iPod, need help

    So I got my dad's old iPod nano, 1st gen with 2 GB. I tried to plug it in with no luck. So I go into the iPod as a storage device in my computer, the iTunes folder is "corrupt and unreadable." I read somewhere I can format the iPod and it will be ok, I do so because I'm stupid. Now, it isn't even recognized as a storage device, it's just and unknown device with no drivers. To be clear, I right clicked the iPod in My Computer and went to format and formatted it, I need help getting it working again.

    Did you format it as FAT32 and not use quick format?
    After you do that, Restore it in iTunes.

  • Need help in formating a form dealing with negative currency

    Need Help!!!
    Creating forms in Adobe acrobat Pro I could format a number cell to calculate additions/subtractions of currency. If the result was negative I could get the cell to show the negative result in red text and show parentheses around them. How can I do that in LiveCycle?
    If i have to use formcalc - what would i type in?

    In LiveCycle can be done using the Numeric Field object and some formcalc script.
    Use the "Numeric Field" from the Object Library. For the Field patterns (Select the placed numeric field, On object Window Object -> Field) use "num.currency{}" to show the currency(Ex: $) and "parentheses" if its negative. Write some script to show red text/border in red .
    On exit event of the Numeric Field here is the script:
    if($.rawValue <0) then $.font.fill.color.value = "255,0,0" endif  // This will make entire text in red color if the value is negative.
    if($.rawValue <0) then $.validate.nullTest = "error" endif      //This will make border of the field in red color if the value is negative.
    Hope this helps.

  • My daughter has spitefully changed my password and has refused to tell me. I have so much medical information that I can not lose. Is there anyway to get around this problem. Please I need Help fast.

    My daughter has spitefully changed my password and has refused to tell me. I have so much medical information that I can not lose. Is there anyway to get around this problem. Please I need Help fast.

    Connect the iPod to your syncing computer and restore it via iTunes.  However, if iTunes asks for the unknown passcode you need to place the iPod in recovery mode and then restore the iPod from backup.  For recovey mode see:
    iPhone and iPod touch: Unable to update or restore
    "If you cannot remember the passcode, you will need to restore your device using the computer with which you last synced it. This allows you to reset your passcode and resync the data from the device (or restore from a backup). If you restore on a different computer that was never synced with the device, you will be able to unlock the device for use and remove the passcode, but your data will not be present. Refer to Updating and restoring iPhone and iPod touch software."
    Above is from:
    http://support.apple.com/kb/ht1212

  • My ipod touch is in DFU mode 5g I need help, do not want to lose my data, please help in Spanish

    I need help, do not want to lose my data, PLEASE HELP IN SPANISH

    Una vez que el dispositivo está pidiendo ser restaurado con iTunes ... ya es demasiado tarde para salvar nada ... y usted debe continuar con la recuperación de ...
    Vea aquí> http://support.apple.com/kb/HT1808
    Es posible que tenga que probar más de una vez ... Asegúrese de seguir todos los pasos ...
    Tómese su tiempo ... Preste especial atención a los pasos 3 y 4.
    Para minimizar la pérdida ...
    Después de haber recuperado su dispositivo ...
    Re-sincronizar su contenido o restauración de la última copia de seguridad ...
    Restaurar desde copia de seguridad> http://support.apple.com/kb/ht1766
    Once the Device is asking to be Restored with iTunes... it is too late to save anything... and you must continue with the Recovery...
    See Here  >  http://support.apple.com/kb/HT1808
    You may need to try this More than Once...  Be sure to Follow ALL the Steps...
    Take your time... Pay particular attention to Steps 3 and 4.
    To minimise loss...
    After you have Recovered your Device...
    Re-Sync your Content or Restore from the most recent Backup...
    Restore from Backup  >  http://support.apple.com/kb/ht1766

  • Need help in formatting the Date - Date does not

    Need help in formatting the Date - Date does not formats and give Not a valid month error in the below scenario.
    select oc.ST_PGM_MGR, r.ag_dnum, get_major_work_type(r.perf_eval_rtng_id) "v_work_code", r.ag_dnum_supp "supp", r.intfinal, to_char(r.formdate,'MM/DD/YYYY') "formdate", to_char(r.servfrom,'MM/DD/YYYY') "srv_from", to_char(r.servto,'MM/DD/YYYY') "srv_to", descript, add_months(to_char
    --- Bellow line of Code on trying to format it to mm/dd/yyyy gives the error
    (r.formdate, 'DD-MON-YYYY'),12) "formdate2"
    from  table REdited by: Lucy Discover on Jul 7, 2011 11:34 AM
    Edited by: Lucy Discover on Jul 7, 2011 1:05 PM

    Your syntax is wrong - look at the post above where this syntax is given:
    to_char (add_months(r.formdate,12), 'MM/DD/YYYY') "formdate2"Look at the formula from a logical perspective - "inside out" to read what is happening -
    take formdate, add 12 months
    add_months(r.formdate, 12)then apply the to_char format mask - basic syntax
    to_char(date, 'MM/DD/YYYY')Compare to your syntax:
    to_char(add_months(r.formdate, 'MM/DD/YYYY'),12) "formdate2"You will see your format string inside the call to add_months, and your 12 inside the call to to_char.
    Good luck!

  • I need help! when I am importing my NEF files from my D3300 camera into lightroom 5 and try to use the "copy as DNG" button I always get an error message saying that "saying the file is not recognized by the raw format support"

    I need help! when I am importing my NEF Raw files from my D3300 camera into lightroom 5 and try to use the "copy as DNG" button I always get an error message saying that "saying the file is not recognized by the raw format support". The whole purpose of that button is so that the file can be recognized... How can I make the "copy as DNG" button work as it is supposed too?? Thank you

    Thank you for responding. So I essentially will never be able to use that button in lightroom 5? do I need to get LR 6? Will there ever be an update for LR 5 that will enable me to use it?
    Does DNG Converter work within LR or do I have to upload pictures to my computer and then make a second copy in DNG format. and then go into LR and use them?
    Thank you @dj_paige

  • Need help for Format HD

    Hi I need Help for Formating HD so Wat Key need hold on start up for format HD I apprciated you Help

    Jesus:
    Formatting, Partitioning Erasing a Hard Disk Drive
    Warning! This procedure will destroy all data on your Hard Disk Drive. Be sure you have an up-to-date, tested backup of at least your Users folder and any third party applications you do not want to re-install before attempting this procedure.
    • With computer shut down insert install disk in optical drive.
    • Hit Power button and immediately after chime hold down the "C" key.
    • Select language
    • Go to the Utilities menu (Tiger) Installer menu (Panther & earlier) and launch Disk Utility.
    • Select your HDD (manufacturer ID) in left side bar.
    • Select Partition tab in main panel. (You are about to create a single partition volume.)
    • _Where available_ +Click on Options button+
    +• Select Apple Partition Map (PPC Macs) or GUID Partition Table (Intel Macs)+
    +• Click OK+
    • Select number of partitions in pull-down menu above Volume diagram.
    (Note 1: One partition is normally preferable for an internal HDD.)
    • Type in name in Name field (usually Macintosh HD)
    • Select Volume Format as Mac OS Extended (Journaled)
    • Click Partition button at bottom of panel.
    • Select Erase tab
    • Select the sub-volume (indented) under Manufacturer ID (usually Macintosh HD).
    • Check to be sure your Volume Name and Volume Format are correct.
    • Click Erase button
    • Quit Disk Utility.
    cornelius

  • Need help on ammount formating with num{$z,zzz,zz9.99}

    Hi All
    Need help in formating the amount fields.
    Currently I am using num{$z,zzz,zz9.99} Its working fine for positive ammount value.
    But for negative amount its giving output as $-18,970.50
    Expected out is -$18,970.50
    need '-' sign before $
    Thanks,
    Abhijit

    issue resolved by setting pattern as  = num{z$z,zzz,zz9.99}

Maybe you are looking for

  • Copy characteristic value(class 023 ) from the material master to the batch

    Dear All, Is there a way to copy the characteristic value (class 123) from material master to the batch master automatically once we create a batch of that material I tried to create a dependency, but didnu2019t know what to write in the dependency e

  • Use of EXIST clause

    Need to seek advice on the use of EXISTS clause. What is this statement trying to do? What is the '1' in the inner SELECT statement means? DELETE FROM a WHERE NOT EXISTS (SELECT 1 FROM b WHERE a.a_id = b.a_id); What about these 2 statements doing?? S

  • Old VHS tape to DVD

    I have a old VHS tape that I made but want to put it on A DVD or CD. Is there anything cheap that I can get so I can transfer it to my computer and burn it from there? Its only about 15 minutes long so its not really a big deal but not sure on how to

  • Material Document number

    Hi MM Gurus,            Is it possible to allocate Material and Accounting Document Ranges of Goods receipt plantwise? Kindly give your valuable inputs. Ex: Plant 1 :  5000000000 to 5000010000 Plant 2 :  5000010001 to 5000020000 etc. Regards Yoga

  • Need Help On Adobe Premiere elements 12

    I have made a recording on my DVR  and captured it onto my laptop with the Hauppauge capture device without a problem  I have edited it with the Premiere elements but upon reviewing it it looks a little more pixilated than the original. What are the