Skip to content

Commit 58be638

Browse files
committed
Fixup IdentityTemplate handler.
1 parent f191b73 commit 58be638

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tool/sdg/src/main/java/org/openscience/cdk/layout/IdentityTemplateLibrary.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,14 +290,14 @@ static String encodeEntry(Entry<String, Point2d[]> entry) {
290290
* @return extended SMILES format coordinates
291291
*/
292292
static String encodeCoordinates(Point2d[] points) {
293+
DecimalFormat fmt = new DecimalFormat("#.##");
293294
StringBuilder sb = new StringBuilder();
294295
sb.append("|(");
295296
for (Point2d point : points) {
296297
if (sb.length() > 2) sb.append(";");
297-
DecimalFormat fmt;
298-
sb.append(String.format(Locale.ROOT, "%.2f", point.x));
298+
sb.append(fmt.format(point.x));
299299
sb.append(',');
300-
sb.append(String.format(Locale.ROOT, "%.2f", point.y));
300+
sb.append(fmt.format(point.y));
301301
sb.append(',');
302302
}
303303
sb.append(")|");

0 commit comments

Comments
 (0)