Esteemed
Our cloud hosted instance of erpnext 16 reply me as follow
Currency in words fail with 0.57 and 0.58 (0,57 or 0,58)
Dear Customer,
Thank you for reporting the issue.
We investigated the behavior and were able to reproduce it. This appears to be an official bug in ERPNext v16/Frappe, rather than an issue with your configuration.
For example:
from frappe.utils.data import money_in_words
print(money_in_words(0.57))
# Cincuenta Y Seis Céntimo solamente.
print(money_in_words(0.58))
# Cincuenta Y Siete Céntimo solamente.
After reviewing the source code, we found that the issue is caused by floating-point precision during the conversion of the fractional part:
def fraction_in_words() -> str:
return in_words(float(f"0.{fraction}") * fraction_units, in_million).title()
For example:
As a result, 0.57 is converted to 56, and 0.58 is converted to 57, producing the incorrect “In Words” output.
We also tested the latest available ERPNext/Frappe v16 updates, but the issue still exists, indicating that it has not yet been resolved upstream.
As a workaround, we recommend using ERPNext v15, where this issue does not occur.
Please let us know how you would like to proceed, and we will be happy to assist further.
Best regards,
Queta
Support Department