Skip to content

Commit

Permalink
Use Locale.ROOT instead of .US
Browse files Browse the repository at this point in the history
  • Loading branch information
egonw committed Jan 7, 2019
1 parent 08286b9 commit 6d6d58f
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,9 @@ public FormatStringBuffer format(double dbl) {

NumberFormat nf;
if ((fmt.flags & SCI) > 0) {
nf = new DecimalFormat("0.#E00", DecimalFormatSymbols.getInstance(Locale.US));
nf = new DecimalFormat("0.#E00", DecimalFormatSymbols.getInstance(Locale.ROOT));
} else {
nf = NumberFormat.getInstance(Locale.US);
nf = NumberFormat.getInstance(Locale.ROOT);
}
nf.setGroupingUsed((fmt.flags & GROUPING) != 0);
if (fmt.precision != -1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
public final class MDLV3000Writer extends DefaultChemObjectWriter {

public static final SimpleDateFormat HEADER_DATE_FORMAT = new SimpleDateFormat("MMddyyHHmm");
public static final NumberFormat DECIMAL_FORMAT = new DecimalFormat("#.####", DecimalFormatSymbols.getInstance(Locale.US));
public static final NumberFormat DECIMAL_FORMAT = new DecimalFormat("#.####", DecimalFormatSymbols.getInstance(Locale.ROOT));
private static final Pattern R_GRP_NUM = Pattern.compile("R(\\d+)");
private V30LineWriter writer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public Mopac7Writer(OutputStream out) throws IOException {
* @param out {@link Writer} to which the output is written
*/
public Mopac7Writer(Writer out) throws IOException {
numberFormat = NumberFormat.getInstance(Locale.US);
numberFormat = NumberFormat.getInstance(Locale.ROOT);
numberFormat.setMaximumFractionDigits(4);
writer = new BufferedWriter(out);
initIOSettings();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public void write(IChemObject object) throws CDKException {
}
if (datemap.get(chemObject) != null) {
Element dateElement = new Element("dc:date", NS_DCELEMENTS);
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.US);
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.ROOT);
dateElement.appendChild(new Text(formatter.format((Date) datemap.get(chemObject)) + timezone));
itemElement.appendChild(dateElement);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public int compare(List<Integer> a, List<Integer> b) {
// 2D/3D Coordinates
if (SmiFlavor.isSet(opts, SmiFlavor.CxCoordinates) &&
state.atomCoords != null && !state.atomCoords.isEmpty()) {
DecimalFormat fmt = new DecimalFormat("#.##", DecimalFormatSymbols.getInstance(Locale.US));
DecimalFormat fmt = new DecimalFormat("#.##", DecimalFormatSymbols.getInstance(Locale.ROOT));
if (sb.length() > 2) sb.append(',');
sb.append('(');
for (int i = 0; i < ordering.length; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
*/
final class IdentityTemplateLibrary {

private static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat(".##", DecimalFormatSymbols.getInstance(Locale.US));
private static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat(".##", DecimalFormatSymbols.getInstance(Locale.ROOT));

private final Multimap<String, Point2d[]> templateMap = LinkedListMultimap.create();

Expand Down

0 comments on commit 6d6d58f

Please sign in to comment.