From 5b5a46556ddaba1415029aa585bdfebd7acf180d Mon Sep 17 00:00:00 2001 From: TT Date: Tue, 27 Aug 2019 21:21:16 +0900 Subject: [PATCH] view: show scale with prefix in linear format --- plot.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plot.c b/plot.c index 2a3423e..95d225e 100644 --- a/plot.c +++ b/plot.c @@ -681,6 +681,7 @@ void trace_get_info(int t, char *buf, int len) { const char *type = get_trace_typename(t); + int n; switch (trace[t].type) { case TRC_LOGMAG: chsnprintf(buf, len, "%s %ddB/", type, (int)get_trace_scale(t)); @@ -694,7 +695,8 @@ trace_get_info(int t, char *buf, int len) chsnprintf(buf, len, "%s %.1fFS", type, get_trace_scale(t)); break; default: - chsnprintf(buf, len, "%s %.1f/", type, get_trace_scale(t)); + n = chsnprintf(buf, len, "%s ", type); + string_value_with_prefix(buf+n, len-n, get_trace_scale(t), '/'); break; } }