About 178,000 results
Open links in new tab
  1. Convert String to double in Java - Stack Overflow

    Apr 24, 2011 · To convert a string back into a double, try the following. String s = "10.1"; Double d = Double.parseDouble(s); The parseDouble method will achieve the desired effect, and so will …

  2. java - Converting double to string - Stack Overflow

    Using Double.toString(), if the number is too small or too large, you will get a scientific notation like this: 3.4875546345347673E-6.

  3. format - Convert a String to Double - Java - Stack Overflow

    Jul 19, 2013 · Double d = Double.parseDouble(s.replaceAll(",","")); I haven't bothered with locales since you specifically stated you wanted commas replaced so I'm assuming you've already …

  4. String.format () to format double in Java - Stack Overflow

    Using String formatter. System.out.println(String.format("%1$,.2f", number)); In all cases the output will be: 2354548.24. Note: During rounding you can add RoundingMode in your …

  5. Java correct way convert/cast object to Double - Stack Overflow

    Jul 25, 2020 · valueOf(double d); and. valueOf(String s); Those methods give you a way of getting a Double instance from a String or double primitive. (Also not the constructors; read the …

  6. Convert double to String in Java - Stack Overflow

    double d=12345678.999; String str = String.valueOf(d); or, just plain. String str = ""+d; Does it, however in the exponent form-- returning the String value: 1.2345678999E7 I need the value …

  7. types - Convert a double to a String in Java and vice versa without ...

    Oct 18, 2011 · A String representation of a double is written to and read from a file by a C# application. The C# application converts the double to a string using the following fragment: …

  8. java - convert string into int or double? - Stack Overflow

    Dec 13, 2012 · If num is your string to convert. Considering you asked to convert to a double too, you will have to convert it with. Double.parseDouble(num); The only problem is if you test for …

  9. Convert Integer, Double to String in Java - Stack Overflow

    Jun 11, 2012 · Java string.valueOf() method converts different types of value such as long,int,double,float into String. Double double_val=45.9; String …

  10. How to cast from List<Double> to double [] in Java?

    May 16, 2011 · First you have to convert List<Double> to Double[] by using . Double[] array = frameList.toArray(new Double[frameList.size()]); Next you can convert Double[] to double[] …

Refresh