代码提交点位地图1
This commit is contained in:
parent
d145df182a
commit
694e16240c
@ -5461,8 +5461,12 @@ public class TsFilesServiceImpl extends ServiceImpl<TsFilesMapper, TsFiles> impl
|
|||||||
// 假设 UtcTime 是 String 类型,首先转换为 double 类型
|
// 假设 UtcTime 是 String 类型,首先转换为 double 类型
|
||||||
double time1 = Double.parseDouble(data1.getUtcTime()); // 如果 getUtcTime() 返回 String 类型
|
double time1 = Double.parseDouble(data1.getUtcTime()); // 如果 getUtcTime() 返回 String 类型
|
||||||
double time2 = Double.parseDouble(data2.getUtcTime()); // 如果 getUtcTime() 返回 String 类型
|
double time2 = Double.parseDouble(data2.getUtcTime()); // 如果 getUtcTime() 返回 String 类型
|
||||||
|
// 保留小数点后六位
|
||||||
|
double formattedTime1 = Double.parseDouble(String.format("%.6f", time1));
|
||||||
|
double formattedTime2 = Double.parseDouble(String.format("%.6f", time2));
|
||||||
|
|
||||||
// 计算差值
|
// 计算差值
|
||||||
double diff = time2 - time1;
|
double diff = formattedTime2 - formattedTime1;
|
||||||
// 确保差值不为零,以避免除以零错误
|
// 确保差值不为零,以避免除以零错误
|
||||||
if (diff != 0) {
|
if (diff != 0) {
|
||||||
result = (int) Math.floor(1 / diff);
|
result = (int) Math.floor(1 / diff);
|
||||||
|
Loading…
Reference in New Issue
Block a user