Skip to content

Commit

Permalink
fix: show 0 for empty currency, float, & duration fields in list view
Browse files Browse the repository at this point in the history
(cherry picked from commit 97f97a8)
  • Loading branch information
shariquerik authored and mergify[bot] committed Nov 1, 2022
1 parent ffe4d29 commit 6edbbd4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions frappe/public/js/frappe/form/formatters.js
Expand Up @@ -66,10 +66,9 @@ frappe.form.formatters = {
}
}

return frappe.form.formatters._right(
value == null || value === "" ? "" : format_number(value, null, precision),
options
);
value = value == null || value === "" ? "" : value;

return frappe.form.formatters._right(format_number(value, null, precision), options);
}
},
Int: function (value, docfield, options) {
Expand Down Expand Up @@ -121,7 +120,8 @@ frappe.form.formatters = {
}
}

value = value == null || value === "" ? "" : format_currency(value, currency, precision);
value = value == null || value === "" ? "" : value;
value = format_currency(value, currency, precision);

if (options && options.only_value) {
return value;
Expand Down Expand Up @@ -248,7 +248,7 @@ frappe.form.formatters = {
value = frappe.utils.get_formatted_duration(value, duration_options);
}

return value || "";
return value || "0s";
},
LikedBy: function (value) {
var html = "";
Expand Down

0 comments on commit 6edbbd4

Please sign in to comment.