File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/main/java/com/neuronrobotics/sdk/addons/kinematics/math Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff 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 " ;
You can’t perform that action at this time.
0 commit comments