From 1e49e14e4ce706ec58600ba858fc5e1aafede85a Mon Sep 17 00:00:00 2001 From: daovietanh99 Date: Thu, 15 Feb 2024 15:23:42 +0700 Subject: [PATCH] UPDATE: chang number format to 1 decimal place --- cope2n-api/fwd_api/utils/file.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cope2n-api/fwd_api/utils/file.py b/cope2n-api/fwd_api/utils/file.py index b71604e..1a49e30 100644 --- a/cope2n-api/fwd_api/utils/file.py +++ b/cope2n-api/fwd_api/utils/file.py @@ -524,8 +524,10 @@ def dict2xlsx(input: json, _type='report'): ws[key + str(start_index)].style = normal_cell elif _type == 'report_detail': if 'accuracy' in mapping[key] and type(value) in [int, float] and value < 75: + ws[key + str(start_index)].number_format = '0.0' ws[key + str(start_index)].style = normal_cell_red elif 'speed' in mapping[key] and type(value) in [int, float] and value > 2.0: + ws[key + str(start_index)].number_format = '0.0' ws[key + str(start_index)].style = normal_cell_red else: ws[key + str(start_index)].style = normal_cell