fix(formatter): display zero amounts as formatted currency values (#6227)

This commit is contained in:
Alchez 2018-10-15 09:26:34 +05:30 committed by Rushabh Mehta
parent 199000c074
commit c0ebdec392

View file

@ -23,8 +23,8 @@ frappe.form.formatters = {
},
Float: function(value, docfield, options, doc) {
// don't allow 0 precision for Floats, hence or'ing with null
var precision = docfield.precision
|| cint(frappe.boot.sysdefaults && frappe.boot.sysdefaults.float_precision)
var precision = docfield.precision
|| cint(frappe.boot.sysdefaults && frappe.boot.sysdefaults.float_precision)
|| null;
if (docfield.options && docfield.options.trim()) {
// options points to a currency field, but expects precision of float!
@ -67,7 +67,7 @@ frappe.form.formatters = {
}
}
value = (value == null || value == "") ? "" : format_currency(value, currency, precision);
value = (value == null || value === "") ? "" : format_currency(value, currency, precision);
if ( options && options.only_value ) {
return value;