×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Aug 2010
    Location
    Chennai, India.
    Posts
    176

    How to convert a string into..?

    Experts,

    Im doing j2me apps, I have a string that i want to convert into double for manipulation. I have a string "49997993357",

    when i convert into double like

    Double.parseDouble(Balance) ;
    Double.valueOf(Balance);
    Double.valueOf(Balance).doubleValue();

    Its not converting into double. Im getting hexaDecimal value is 4.9997993357E10.

    Is there any other method to convert into double value..?

  2. #2
    Regular Contributor
    Join Date
    Aug 2010
    Location
    Chennai, India.
    Posts
    176

    Re: How to convert a string into..?

    Im getting value with scientific notation..? How do i get the correct double value from string..?

    I m not able to use BigDecimal and NumberFormat of java.text package in J2Me...?

    Suggest me any ideas..?
    Last edited by kumar1234567; 2011-09-23 at 08:15.

  3. #3
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: How to convert a string into..?

    Hmmm.. am I missing something?
    49997993357 = 4.9997993357E10
    so you are getting the correct value which you can use in the calculations. The system just represents the big double number with scientific notation.

    Hartti

  4. #4
    Regular Contributor
    Join Date
    Aug 2010
    Location
    Chennai, India.
    Posts
    176

    Re: How to convert a string into..?

    Yes, It is double value. But After calculation and addition of another double number and by displaying it, am getting 4.9997993357E10 value.

    If the length of the number is less, not more than 10, am able to convert and do calculation.

    How do i want to show big double with scientific notation into double value..?

    kumar

  5. #5
    Regular Contributor
    Join Date
    Aug 2010
    Location
    Chennai, India.
    Posts
    176

    Re: How to convert a string into..?

    Y'day i got solution, a scientific notation double value into string to display, here it may usefull to others

Similar Threads

  1. How to convert string to string array
    By murugacse4 in forum Mobile Java General
    Replies: 3
    Last Post: 2011-07-02, 10:12
  2. how to convert hex to string
    By nehasaxena in forum Symbian
    Replies: 3
    Last Post: 2009-09-19, 15:19
  3. How to convert UTF8 string to WCHAR string.
    By varungu in forum Open C/C++
    Replies: 1
    Last Post: 2008-01-31, 12:36
  4. convert to string
    By pmdr05 in forum Symbian
    Replies: 4
    Last Post: 2007-02-09, 07:15
  5. convert to string
    By pmdr05 in forum Mobile Java General
    Replies: 3
    Last Post: 2007-02-08, 21:32

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×