Ver a proveniência

Merge pull request #3488 from nabinhait/in_words_fix

get correct number format info in in_words function
version-14
Makarand Bauskar há 8 anos
committed by GitHub
ascendente
cometimento
7bc97cbf36
1 ficheiros alterados com 2 adições e 1 eliminações
  1. +2
    -1
      frappe/utils/data.py

+ 2
- 1
frappe/utils/data.py Ver ficheiro

@@ -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('.')




Carregando…
Cancelar
Guardar