[fix] Use df.precision if specified
This commit is contained in:
parent
b3042546b1
commit
ab286a89be
1 changed files with 6 additions and 2 deletions
|
|
@ -258,9 +258,10 @@ def get_field_precision(df, doc):
|
|||
"""get precision based on DocField options and fieldvalue in doc"""
|
||||
from frappe.utils import get_number_format_info
|
||||
|
||||
precision = cint(df.precision) or cint(frappe.db.get_default("float_precision")) or 3
|
||||
if cint(df.precision):
|
||||
precision = cint(df.precision)
|
||||
|
||||
if df.fieldtype == "Currency":
|
||||
elif df.fieldtype == "Currency":
|
||||
number_format = None
|
||||
currency = get_field_currency(df, doc)
|
||||
|
||||
|
|
@ -276,6 +277,9 @@ def get_field_precision(df, doc):
|
|||
|
||||
decimal_str, comma_str, precision = get_number_format_info(number_format)
|
||||
|
||||
else:
|
||||
precision = cint(frappe.db.get_default("float_precision")) or 3
|
||||
|
||||
return precision
|
||||
|
||||
def clear_cache(doctype=None):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue