Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If you want to use "," as some EU countries using. You have to carefully take care of your localization.</p> <p>Look at java api <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Double.html" rel="nofollow noreferrer">http://docs.oracle.com/javase/7/docs/api/java/lang/Double.html</a></p> <p>at valueOf, it said </p> <pre><code>To interpret localized string representations of a floating-point value, use subclasses of NumberFormat. </code></pre> <p>For example, this code will solve your problem,</p> <pre><code>NumberFormat nf = NumberFormat.getInstance(Locale.GERMAN); double number = nf.parse(myString).doubleValue(); </code></pre> <p>One important thing, you <strong>must</strong> not use something like</p> <pre><code>Locale.setDefault(something); </code></pre> <p>Because it can affect the whole JVM. In other words, that means it can affect the other codes which are using localization. Moreover it can affect the other apps which are in the same JVM if you are using Containner such as Servlet Container (such as shared Tomcat hosting).</p> <p><strong>And most of the time, something like Locale.setDefault() can be used in your local computer but you cannot deploy it on the other servers (shared tomcat hosting) because their JRE may be set permission to not allow to do such method. I'am pretty sure that most of good hosting providers did this. If you can deploy such this code on any shared Tomcats in any hosting providers, I strongly recommend you to change to another hosting company.</strong></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload