Merge pull request #5786 from pratu16x7/float-precision
[formatters] add check for boot.sysdefaults, fixes frappe/erpnext#14796
This commit is contained in:
commit
4fc37a6cf1
1 changed files with 3 additions and 1 deletions
|
|
@ -23,7 +23,9 @@ 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.float_precision) || null;
|
||||
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!
|
||||
docfield.precision = precision;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue