fix: percent precision when value is undefined (#37755)

Co-authored-by: Nishka Gosalia <nishkagosalia@Nishkas-MacBook-Air.local>
This commit is contained in:
Nishka Gosalia 2026-03-05 12:27:06 +05:30 committed by GitHub
parent 786059047b
commit 29e52f6deb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -94,7 +94,9 @@ frappe.form.formatters = {
if (value === null) {
return "";
}
const valuePrecision = value.toString().split(".")[1]?.length || 0;
const valuePrecision = value?.toString().split(".")[1]?.length || 0;
const precision =
docfield.precision ||
cint(frappe.boot.sysdefaults && frappe.boot.sysdefaults.float_precision) ||