16 lines
414 B
Python
16 lines
414 B
Python
|
|
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
|