小数位数提交

This commit is contained in:
zhaozilong12 2025-08-15 13:51:49 +08:00
parent 7a768c1701
commit c6316a87c4

View File

@ -2502,13 +2502,13 @@ class RealPressureDevice:
right_rear_pct = float((right_rear / right_total_abs * 100) if right_total_abs > 0 else 0)
return {
'left_front': int(left_front_pct),
'left_rear': int(left_rear_pct),
'right_front': int(right_front_pct),
'right_rear': int(right_rear_pct),
'left_total': int(left_total_pct),
'right_total': int(right_total_pct),
'total_pressure': int(total_abs)
'left_front': round(left_front_pct),
'left_rear': round(left_rear_pct),
'right_front': round(right_front_pct),
'right_rear': round(right_rear_pct),
'left_total': round(left_total_pct),
'right_total': round(right_total_pct),
'total_pressure': round(total_abs)
}
except Exception as e:
logger.error(f"计算足部区域压力异常: {e}")