fix: 让采样点占比整列显示为百分比
This commit is contained in:
@@ -384,8 +384,9 @@ def write_book(path, frames):
|
|||||||
sheet = writer.sheets[name]
|
sheet = writer.sheets[name]
|
||||||
percent = [index for index, column in enumerate(frame.columns, 1) if str(column).endswith("移动采样点占比")]
|
percent = [index for index, column in enumerate(frame.columns, 1) if str(column).endswith("移动采样点占比")]
|
||||||
for column in percent:
|
for column in percent:
|
||||||
for cell in sheet.iter_cols(min_col=column, max_col=column, min_row=2, max_row=sheet.max_row):
|
for cells in sheet.iter_cols(min_col=column, max_col=column, min_row=2, max_row=sheet.max_row):
|
||||||
cell[0].number_format = "0.00%"
|
for cell in cells:
|
||||||
|
cell.number_format = "0.00%"
|
||||||
for cell in sheet[1]:
|
for cell in sheet[1]:
|
||||||
sheet.column_dimensions[cell.column_letter].width = max(12, len(str(cell.value)) * 2 + 2)
|
sheet.column_dimensions[cell.column_letter].width = max(12, len(str(cell.value)) * 2 + 2)
|
||||||
sheet.freeze_panes = "C2"
|
sheet.freeze_panes = "C2"
|
||||||
|
|||||||
Reference in New Issue
Block a user