Skip to content

Commit 9bd28a0

Browse files
author
Kevin Harrington
committed
formatting
1 parent 70e70d5 commit 9bd28a0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/main/java/com/neuronrobotics/sdk/addons/kinematics/math/TransformNR.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,16 +222,17 @@ public static String getMatrixString(Matrix matrix) {
222222
String s = "{\n";
223223
double[][] m = matrix.getArray();
224224

225+
DecimalFormat decimalFormat = new DecimalFormat("000.00");
225226
int across = m.length;
226227
int down = m[0].length;
227228

228229
for (int i = 0; i < across; i++) {
229230
s += "{ ";
230231
for (int j = 0; j < down; j++) {
231-
if (m[i][j] < 0)
232-
s += new DecimalFormat("000.00").format(m[i][j]);
233-
else
234-
s += new DecimalFormat("0000.00").format(m[i][j]);
232+
if (m[i][j] < 0) {
233+
s += decimalFormat.format(m[i][j]);
234+
} else
235+
s += decimalFormat.format(m[i][j]);
235236
if (j < down - 1)
236237
s += ",";
237238
s += "\t";

0 commit comments

Comments
 (0)