From 132be58f2ab689a2375b15216b7d1951dab2e7dd Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Tue, 27 Aug 2024 13:50:52 +0800 Subject: [PATCH] fix:[TD-31696]print the float number in a compact way --- source/util/src/tconfig.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/util/src/tconfig.c b/source/util/src/tconfig.c index 5abe943320..5f0ab9a321 100644 --- a/source/util/src/tconfig.c +++ b/source/util/src/tconfig.c @@ -194,7 +194,7 @@ static int32_t cfgSetFloat(SConfigItem *pItem, const char *value, ECfgSrcType st float dval = 0; TAOS_CHECK_RETURN(parseCfgReal(value, &dval)); if (dval < pItem->fmin || dval > pItem->fmax) { - uError("cfg:%s, type:%s src:%s value:%f out of range[%f, %f]", pItem->name, cfgDtypeStr(pItem->dtype), + uError("cfg:%s, type:%s src:%s value:%g out of range[%g, %g]", pItem->name, cfgDtypeStr(pItem->dtype), cfgStypeStr(stype), dval, pItem->fmin, pItem->fmax); TAOS_RETURN(TSDB_CODE_OUT_OF_RANGE); } @@ -484,7 +484,7 @@ int32_t cfgCheckRangeForDynUpdate(SConfig *pCfg, const char *name, const char *p TAOS_RETURN(code); } if (dval < pItem->fmin || dval > pItem->fmax) { - uError("cfg:%s, type:%s value:%f out of range[%f, %f]", pItem->name, cfgDtypeStr(pItem->dtype), dval, + uError("cfg:%s, type:%s value:%g out of range[%g, %g]", pItem->name, cfgDtypeStr(pItem->dtype), dval, pItem->fmin, pItem->fmax); cfgUnLock(pCfg); TAOS_RETURN(TSDB_CODE_OUT_OF_RANGE);