Skip to content

Conversation

@AryanJadhav15
Copy link

Describe your change:

  • Add an algorithm?
    Added a new algorithm string_to_num.py that converts numbers written in English words into their integer or float values.

    to_int ("forty two")
    42
    to_int ("one hundred and five")
    105
    to_int ("seven thousand eight hundred ninety point one three")
    7890
    to_float ("one lakh thirty three thousand five hundred and seven point zero zero nine")
    133507.009

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms include at least one URL that points to Wikipedia or another similar explanation.
  • If this pull request resolves one or more open issues then the description above includes the issue number(s) with a closing keyword: "Fixes #ISSUE-NUMBER".

@algorithms-keeper algorithms-keeper bot added enhancement This PR modified some existing files awaiting reviews This PR is ready to be reviewed labels Oct 1, 2025
@algorithms-keeper algorithms-keeper bot added the tests are failing Do not merge until tests pass label Oct 1, 2025
@AryanJadhav15
Copy link
Author

My file strings/string_to_num.py passes Ruff locally. The other Ruff errors are pre-existing in the repo.

@AryanJadhav15
Copy link
Author

Please help me to pass these tests I am contributing in open source for the first time

@AryanJadhav15 AryanJadhav15 deleted the str_to_int branch October 1, 2025 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting reviews This PR is ready to be reviewed enhancement This PR modified some existing files tests are failing Do not merge until tests pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant