data_process_ui/app/script/format_measure_data.py
2026-01-12 09:21:42 +08:00

12 lines
349 B
Python

import formatter
#规定表格中的数据格式
def table_formatter(row, col):
if col in []:
return formatter.decimal() # 小数 默认精确到后三位
elif col in [4, 5, 6, 7, 8]:
return formatter.decimal("%.2f") # 小数 精确到后两位
elif col in [1, 3]:
return formatter.decimal("%.5f") # 小数 精确到后五位
return None