提交 5656c592 编写于 作者: wmmhello's avatar wmmhello

fix:precision problems in time conversion

上级 715aa50f
......@@ -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;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册