fix: use system number format for currency precision (#36648)

* fix: use system number format for currency precision

* fix: remove default format
This commit is contained in:
Safwan 2026-02-07 12:00:00 +05:30 committed by GitHub
parent 1d9eb802fc
commit 1307ae33eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -912,11 +912,10 @@ def get_field_precision(df, doc=None, currency=None):
def get_precision_from_currency_format(currency: str) -> int:
"""Get precision from currency format string if applicable."""
from frappe.locale import get_number_format
from frappe.utils.number_format import NumberFormat
use_format_from_currency = frappe.get_system_settings("use_number_format_from_currency")
number_format = get_number_format()
number_format = NumberFormat.from_string(frappe.db.get_default("number_format"))
if use_format_from_currency:
currency_format = frappe.db.get_value("Currency", currency, "number_format", cache=True)
number_format = NumberFormat.from_string(currency_format) if currency_format else number_format