From 5656c59261f1597ff30ab78e483db371b2252b8e Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Wed, 18 May 2022 12:06:13 +0800 Subject: [PATCH] fix:precision problems in time conversion --- source/common/src/ttime.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/common/src/ttime.c b/source/common/src/ttime.c index d6332fbbc5..62a7179626 100644 --- a/source/common/src/ttime.c +++ b/source/common/src/ttime.c @@ -476,8 +476,8 @@ int64_t convertTimeFromPrecisionToUnit(int64_t time, int32_t fromPrecision, char // the result of (NANOSECOND_PER_USEC/(double)factors[fromPrecision]) maybe a double switch (fromPrecision) { case TSDB_TIME_PRECISION_MILLI:{ - tmp /= 1000; - time /= 1000; + tmp *= 1000; + time *= 1000; break; } case TSDB_TIME_PRECISION_MICRO:{ @@ -486,8 +486,8 @@ int64_t convertTimeFromPrecisionToUnit(int64_t time, int32_t fromPrecision, char break; } case TSDB_TIME_PRECISION_NANO:{ - tmp *= 1000; - time *= 1000; + tmp /= 1000; + time /= 1000; break; } }