2
0
mirror of https://github.com/frappe/books.git synced 2024-12-25 20:11:15 +00:00

fix: Default precision

This commit is contained in:
Faris Ansari 2019-12-05 00:13:17 +05:30
parent 7af5c30e7b
commit 8f02928cee

View File

@ -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;
});