Display only one decimal in Google Sheet
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
parent
2019c5c434
commit
a914237f66
|
@ -924,6 +924,19 @@ class Pool(models.Model):
|
|||
}
|
||||
})
|
||||
|
||||
# Set number format, display only one decimal
|
||||
number_format_ranges = [f"C{max_row + 1}:{getcol(2 + passage_width * pool_size)}{max_row + 1}",
|
||||
f"C{max_row + 3}:{getcol(2 + passage_width * pool_size)}{max_row + 3}",
|
||||
f"D{max_row + 6}:D{max_row + 5 + pool_size}",]
|
||||
for number_format_range in number_format_ranges:
|
||||
format_requests.append({
|
||||
"repeatCell": {
|
||||
"range": a1_range_to_grid_range(number_format_range, worksheet.id),
|
||||
"cell": {"userEnteredFormat": {"numberFormat": {"type": "NUMBER", "pattern": "0.0"}}},
|
||||
"fields": "userEnteredFormat.numberFormat",
|
||||
}
|
||||
})
|
||||
|
||||
# Remove old protected ranges
|
||||
for protected_range in spreadsheet.list_protected_ranges(worksheet.id):
|
||||
format_requests.append({
|
||||
|
|
Loading…
Reference in New Issue