I'm from Sweden, and Eclipse and/or my Java installation seems to know this, because it prints floats with a comma instead of a dot, so 0.01
is written as 0,01
, which is the standard here. I want to write some floats to file and then read and plot them with python, so I'm afraid that the commas are going to give me trouble. How can I make Java write to file with the dot instead of comma?
For example:
BufferedWriter bw = null;
try{
bw = new BufferedWriter( new FileWriter(filename) );
bw.write(String.format("%d;%f", 1, 0.000268));
bw.newLine();
bw.flush();
} catch(IOException e) {
e.printStackTrace();
}
should produce:
1;0.000268
instead of
1;0,000268
.