Skip to content

Commit 58adfd3

Browse files
committed
display formatting
1 parent 2ba339b commit 58adfd3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

roboticstoolbox/robot/Link.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,13 @@ def _format(self, l, name, ignorevalue=0, indices=None): # noqa # pragma nocov
250250
if v is None:
251251
return
252252
if isscalar(v) and v != ignorevalue:
253-
s = f"{name}={v}"
253+
s = f"{name}={v:.3g}"
254254
elif isinstance(v, np.ndarray):
255255
if np.linalg.norm(v, ord=np.inf) > 0:
256256
if indices is not None:
257257
flat = v.flatten()
258258
v = np.r_[[flat[k] for k in indices]]
259-
s = f"{name}=[" + ", ".join([str(x) for x in v]) + "]"
259+
s = f"{name}=[" + ", ".join([f"{x:.3g}" for x in v]) + "]"
260260
if s is not None:
261261
l.append(s)
262262

0 commit comments

Comments
 (0)