I currently use the following code to print a double: return String.format(“%.2f”, someDouble); This works well, except that Java uses my Locale’s decimal separator (a comma) while I would like to …
Tag: double
Java double initialization
In what way are these statements different? double dummy = 0; double dummy = 0.0; double dummy = 0.0d; double dummy = 0.0D; Answer Having tried a simple program (using both 0 and 100, to show the difference between “special” constants and general ones) the Sun Java 6 compiler will output the same bytecode for both 1 and 2 (cases