mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
20 lines
650 B
HTML
20 lines
650 B
HTML
<html>
|
|
<body>
|
|
Reports <code>toString()</code> calls on objects of a class extending <code>Number</code>.
|
|
Such calls are usually incorrect in an internationalized environment and some locale specific formatting should be used instead.
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
void print(Double d) {
|
|
System.out.println(d.toString());
|
|
}
|
|
</code></pre>
|
|
A possible way to fix this problem could be:
|
|
<pre><code>
|
|
void print(Double d) {
|
|
System.out.printf("%f%n", d);
|
|
}
|
|
</code></pre>
|
|
This formats the number using the default locale which is set during the startup of the JVM and is based on the host environment.
|
|
<!-- tooltip end -->
|
|
</body>
|
|
</html> |