From 8f02928cee42ab9b29932aacd08384c817e1bb5f Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Thu, 5 Dec 2019 00:13:17 +0530 Subject: [PATCH] fix: Default precision --- model/meta.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/model/meta.js b/model/meta.js index 2965ab03..67cb7ae4 100644 --- a/model/meta.js +++ b/model/meta.js @@ -45,7 +45,8 @@ module.exports = class BaseMeta extends BaseDocument { // attach default precision to Float and Currency this.fields = this.fields.map(df => { if (['Float', 'Currency'].includes(df.fieldtype)) { - df.precision = df.precision || frappe.SystemSettings.floatPrecision; + let defaultPrecision = frappe.SystemSettings ? frappe.SystemSettings.floatPrecision : 2; + df.precision = df.precision || defaultPrecision; } return df; });