At 12:10 11/03/2006, Prof. Robert John Lancashire wrote:
Miguel et al,

On looking through the Locale sensitive calls, of which there are over 10, I see
that JSpecView is only using 2 or 3 of them.

The one of interest was DecimalFormat so I changed all (~20) occurrences of
things like
new DecimalFormat("0.000000") to

new DecimalFormat("0.000000", new DecimalFormatSymbols(java.util.Locale.US ));

and removed the setDefault(US) so that system calls are now in the
language set by the OS and not all forced into English.

This seems to work at least when I set my PC to French and German
the program and applet runs and reads files OK.

I had the same problem when we had a visit from - I think - Stefan Kuhn and we fixed it with:
                DecimalFormat format = new DecimalFormat();
DecimalFormatSymbols symbols = format.getDecimalFormatSymbols();
                symbols.setDecimalSeparator('.');
                format.setDecimalFormatSymbols(symbols);
                format.applyPattern("####0.0000");

                String s = format.format(value);
                while (s.length() < 10) {
                        s = " " + s;
                }
                return s;

It was a reminder that getting rid of all bugs is tough and that the code should be run on as many platforms as possible.



Peter Murray-Rust
Unilever Centre for Molecular Sciences Informatics
University of Cambridge,
Lensfield Road,  Cambridge CB2 1EW, UK
+44-1223-763069


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to