From 8bd40b38e15ffcd22c604b6aef51e13ecf979d7d Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Thu, 2 May 2024 12:11:15 +0530 Subject: [PATCH] fix: reportview average of ints should be float (#26284) --- frappe/public/js/frappe/ui/group_by/group_by.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frappe/public/js/frappe/ui/group_by/group_by.js b/frappe/public/js/frappe/ui/group_by/group_by.js index 1fd90ca4e3..349a7140d5 100644 --- a/frappe/public/js/frappe/ui/group_by/group_by.js +++ b/frappe/public/js/frappe/ui/group_by/group_by.js @@ -327,6 +327,9 @@ frappe.ui.GroupBy = class { if (this.aggregate_function === "sum") { docfield.label = __("Sum of {0}", [__(docfield.label, null, docfield.parent)]); } else { + if (docfield.fieldtype == "Int") { + docfield.fieldtype = "Float"; // average of ints can be a float + } docfield.label = __("Average of {0}", [__(docfield.label, null, docfield.parent)]); } }