From 361088ae72f236233f8888007c93d52041d6f768 Mon Sep 17 00:00:00 2001 From: Simon Renblad Date: Fri, 21 Jul 2023 16:20:52 +0800 Subject: [PATCH] tools: add trim argument to format funcs --- artiq/tools.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/artiq/tools.py b/artiq/tools.py index 61678f9bc..8843bf5bb 100644 --- a/artiq/tools.py +++ b/artiq/tools.py @@ -72,6 +72,7 @@ def short_format(v, metadata={}): v_t = np.divide(v, scale) v_str = np.format_float_positional(v_t, precision=precision, + trim='-', unique=True) v_str += " " + unit if unit else "" return v_str @@ -84,6 +85,7 @@ def short_format(v, metadata={}): v_str = np.array2string(v_t, max_line_width=1000, precision=precision, + trim='-', suppress_small=True, separator=', ', threshold=4,