Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Feat/pronounce digits #41
Feat/pronounce digits #41
Changes from 2 commits
37d424d
d1f05a1
764e7bd
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason we treat non-
str
numbers differently here instead of just starting withnumber = str(number)
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review of
pronounce_digits_en
functionThe function
pronounce_digits_en
has been added to handle the pronunciation of digits. It allows for specifying the number of decimal places and whether to pronounce all digits. Here are a few observations and suggestions:isinstance
to differentiate behavior based on the type ofnumber
is a good practice. This ensures that the function can handle different types of inputs robustly.Overall, the function implementation looks solid but consider the above points to further enhance the code quality and robustness.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These aren't correctly rounded; I think this should either treat
places
as "significant figures", or specifically note in the docstring thatplaces
are not sig figs and decimals are truncated as opposed to roundedThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe an extra flag for rounding or not defaulting to True?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect its parsing as a string instead of using
round()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method is a formating method should not modify input, imho not rounding is the expected behaviour and rounding should be done before calling method if needed or via optional flag. This is reading digits not pronouncing the number, the rounding feels application specific even if I can't come up with a good use case where we don't want it....