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

16 lines
414 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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