Sfoglia il codice sorgente

get correct number format info in in_words function

version-14
Nabin Hait 8 anni fa
parent
commit
85851d10d5
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. +2
    -1
      frappe/utils/data.py

+ 2
- 1
frappe/utils/data.py Vedi File

@@ -437,8 +437,9 @@ def money_in_words(number, main_currency = None, fraction_currency=None):


number_format = frappe.db.get_value("Currency", main_currency, "number_format", cache=True) or \ number_format = frappe.db.get_value("Currency", main_currency, "number_format", cache=True) or \
frappe.db.get_default("number_format") or "#,###.##" frappe.db.get_default("number_format") or "#,###.##"
fraction_length = get_number_format_info(number_format)[2]


fraction_length = len(number_format.rsplit('.', 1)[-1])
n = "%.{0}f".format(fraction_length) % number n = "%.{0}f".format(fraction_length) % number
main, fraction = n.split('.') main, fraction = n.split('.')




Caricamento…
Annulla
Salva