data_process_ui/app/script/format_alignment_table.py

16 lines
414 B
Python
Raw Permalink Normal View History

2026-01-12 09:21:42 +08:00
import formatter
#规定表格中的数据格式
def table_formatter(row, col):
if row < 3: # 直曲表前3行为表头不做格式转化
return None
if col in [6, 7, 8]:
return formatter.integer()
elif col in [1, 2, 9, 10, 11, 12, 18, 19]:
return formatter.decimal()
elif col in [3, 13, 14, 15, 16, 17]:
return formatter.kdecimal()
elif col in [4, 5, 20]:
return formatter.angle()
return None