|
7 | 7 | from pandas import DataFrame, ExcelWriter
|
8 | 8 |
|
9 | 9 | from mitosheet.excel_utils import get_column_from_column_index
|
10 |
| -from mitosheet.is_type_utils import is_float_dtype |
| 10 | +from mitosheet.is_type_utils import is_float_dtype, is_int_dtype |
11 | 11 | from mitosheet.types import (
|
12 | 12 | FC_BOOLEAN_IS_FALSE, FC_BOOLEAN_IS_TRUE, FC_DATETIME_EXACTLY,
|
13 | 13 | FC_DATETIME_GREATER, FC_DATETIME_GREATER_THAN_OR_EQUAL, FC_DATETIME_LESS,
|
@@ -152,13 +152,15 @@ def add_number_formatting(
|
152 | 152 | for column_index in default_number_format_column_indexes:
|
153 | 153 | column_header = column_headers[column_index]
|
154 | 154 | dtype = str(df[column_header].dtype)
|
155 |
| - if not is_float_dtype(dtype): |
156 |
| - continue |
157 |
| - |
158 | 155 | column = get_column_from_column_index(column_index)
|
159 | 156 | cell_range = f'{column}2:{column}{sheet.max_row}'
|
160 |
| - for cell in sheet[cell_range]: |
161 |
| - cell[0].number_format = '#,##0.00' |
| 157 | + |
| 158 | + if is_float_dtype(dtype): |
| 159 | + for cell in sheet[cell_range]: |
| 160 | + cell[0].number_format = '#,##0.00' |
| 161 | + if is_int_dtype(dtype): |
| 162 | + for cell in sheet[cell_range]: |
| 163 | + cell[0].number_format = '#,##0' |
162 | 164 |
|
163 | 165 | def add_header_formatting_to_excel_sheet(
|
164 | 166 | writer: ExcelWriter,
|
|
0 commit comments