Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try basic type conversion before calling num2words for safety #694

Closed

Conversation

nonprofittechy
Copy link
Contributor

This modifies the number_to_word function so that it attempts basic type conversion of the number value into an integer, which is required by num2words package. If the type conversion fails, the current raise_on_error parameter is still respected.

Currently, this error occurs when passing an undefined value to ordinal_number in the DOCX/Jinja2 context.

@jhpyle
Copy link
Owner

jhpyle commented Oct 4, 2023

Thanks. I didn't make this change but I did something else that I think will have the same effect while still permitting the function to be called with a float.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants