info: change dbm format string
Alexander Aring
maintainerPATCH 1/1 info: change dbm format string
This patch changes the dbm format string to %.3g instead %.2g. The reason is that it shows not well for a 3-digit number like "-100" is shown as "-1e+02". A format string of %.3g will fix that.
Signed-off-by Alexander Aring <[email protected]>
Reported-by Craig Younkins <[email protected]>
--- src/info.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
src/info.c +2 -2
@@ -163,7 +163,7 @@ static int print_phy_handler(struct nl_msg *msg, void *arg)printf ("\ttx_powers: " );nla_for_each_nested (nl_pwrs, tb_caps[NL802154_CAP_ATTR_TX_POWERS ], rem_pwrs) -printf ("%.2g," ,MBM_TO_DBM (nla_get_s32 (nl_pwrs))); +printf ("%.3g," ,MBM_TO_DBM (nla_get_s32 (nl_pwrs)));/* TODO */ printf ("\b \n" ); }
@@ -174,7 +174,7 @@ static int print_phy_handler(struct nl_msg *msg, void *arg)printf ("\tcca_ed_levels: " );nla_for_each_nested (nl_levels, tb_caps[NL802154_CAP_ATTR_CCA_ED_LEVELS ], rem_levels) -printf ("%.2g," ,MBM_TO_DBM (nla_get_s32 (nl_levels))); +printf ("%.3g," ,MBM_TO_DBM (nla_get_s32 (nl_levels)));/* TODO */ printf ("\b \n" ); }
Signature · 1 line
2.3.7