fix: Avoid unnecessary cint calls
This commit is contained in:
parent
08287fa6f2
commit
57bac6fff8
3 changed files with 4 additions and 4 deletions
|
|
@ -549,7 +549,7 @@ def get_field_precision(df, doc=None, currency=None):
|
|||
|
||||
elif df.fieldtype == "Currency":
|
||||
if df.precision and cint(df.precision) == 0:
|
||||
precision = cint(df.precision)
|
||||
precision = 0
|
||||
else:
|
||||
precision = cint(frappe.db.get_default("currency_precision"))
|
||||
if not precision:
|
||||
|
|
|
|||
|
|
@ -63,8 +63,8 @@ frappe.form.formatters = {
|
|||
var currency = frappe.meta.get_field_currency(docfield, doc);
|
||||
var precision;
|
||||
|
||||
if (docfield.precision === 0) {
|
||||
precision = docfield.precision;
|
||||
if (docfield.precision && cint(docfield.precision) === 0) {
|
||||
precision = 0;
|
||||
} else {
|
||||
precision = docfield.precision || cint(frappe.boot.sysdefaults.currency_precision) || 2;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ $.extend(frappe.meta, {
|
|||
precision = cint(df.precision);
|
||||
} else if(df && df.fieldtype === "Currency") {
|
||||
if (df.precision && cint(df.precision) === 0) {
|
||||
precision = cint(df.precision);
|
||||
precision = 0;
|
||||
} else {
|
||||
precision = cint(frappe.defaults.get_default("currency_precision"));
|
||||
if(!precision) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue