Browse Source

Merge pull request #3488 from nabinhait/in_words_fix

get correct number format info in in_words function
version-14
Makarand Bauskar 8 years ago
committed by GitHub
parent
commit
7bc97cbf36
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      frappe/utils/data.py

+ 2
- 1
frappe/utils/data.py View 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('.')



Loading…
Cancel
Save