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

Use something like node-numbered to convert words in numbers #9

Closed
faridnsh opened this issue Jul 31, 2017 · 1 comment · Fixed by #37
Closed

Use something like node-numbered to convert words in numbers #9

faridnsh opened this issue Jul 31, 2017 · 1 comment · Fixed by #37

Comments

@faridnsh
Copy link
Contributor

faridnsh commented Jul 31, 2017

Hello @rschmukler ,

To support more word numbers, instead of adding more data, we could use something like node-numbered to do this and remove some code from the project while extending it's support. Would you be accepting such contribution? What do you think?

I suppose, to use that there needs to be a little bit of refactoring on how the code works. I'm thinking we could instead use the following algorithm:

  1. Find the units in the string and split the string using them.
  2. Pass the remaining strings to node-numbered which will convert them to numbers.
  3. Process it and calculate the total.
@simison
Copy link
Member

simison commented Oct 28, 2017

Hey @alFReD-NSH,

I think that's a great idea.

Note that floats like 0.259 we will probably need to Math.round(). Actually nope! Should work just like that. Just need to check how many decimals is ok.

We've just recently moved this repo under @agenda org. Would you feel like submitting a PR + tests for this? That would be sooooo helpful.

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