Sfoglia il codice sorgente

Merge pull request #3488 from nabinhait/in_words_fix

get correct number format info in in_words function
version-14
Makarand Bauskar 8 anni fa
committed by GitHub
parent
commit
7bc97cbf36
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 \
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
main, fraction = n.split('.')



Caricamento…
Annulla
Salva