Results 1 to 3 of 3
  1. #1
    javaMike is offline Member
    Join Date
    Nov 2007
    Posts
    5
    Rep Power
    0

    Question convert string to a double?

    i posted a recent issue about rounding a double to two decimal places...i was able to use the decimalformat class but the only hitch is it converts the number to a string which means i need to convert it back to a double.

    i tried casting but its not permitted, is there another way to convert (cast) a string to a double?

  2. #2
    SFLeBrun is offline Member
    Join Date
    Nov 2007
    Posts
    2
    Rep Power
    0

    Default

    One possibility is to use the stringstream classes and read the string as if it is a character stream.

  3. #3
    staykovmarin is offline Senior Member
    Join Date
    Nov 2007
    Location
    Newport, WA
    Posts
    141
    Rep Power
    0

Similar Threads

  1. How to convert a string into a BigInteger
    By valery in forum New To Java
    Replies: 4
    Last Post: 09-13-2011, 01:32 PM
  2. Replies: 7
    Last Post: 01-12-2008, 09:02 PM
  3. Converting String to Double
    By srini in forum New To Java
    Replies: 1
    Last Post: 12-24-2007, 08:03 PM
  4. Replies: 2
    Last Post: 11-16-2007, 01:24 PM
  5. Help with convert a double type number
    By trill in forum New To Java
    Replies: 1
    Last Post: 08-06-2007, 08:48 AM

Posting Permissions

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