words-to-numbers icon indicating copy to clipboard operation
words-to-numbers copied to clipboard

'twenty-one thousand five hundred seventy-six' => 1596

Open anton-bot opened this issue 6 years ago • 5 comments

wrong conversion as in title

anton-bot avatar Jul 31 '18 06:07 anton-bot

Similar issue with "nine hundred and seventy four thousand" is being turned somehow into "970" and "4000" then being added to return "4970"

It seems to be treating: "nine hundred and seventy four thousand" as "four thousand nine hundred and seventy"

Even more confusingly, running the function on "four thousand nine hundred and seventy" returns undefined.

Wol avatar Apr 12 '20 12:04 Wol

@Wol I wouldn't call that example a bug. Linguistically the and is in the wrong place if you meant to spell out 974,000.

guomo avatar Apr 12 '20 17:04 guomo

Maybe everyone I know says numbers wrong then! What do you call 974000?

For the example 987654 I'd say "nine hundred and eighty seven thousand six hundred and fifty four".

"nine hundred and eighty seven" is the amount of thousands and then "six hundred and fifty four".

Wol avatar Apr 12 '20 17:04 Wol

In America we would say nine hundred seventy four thousand. Following the Chicago manual of Style format. The only time we use the and is when writing cents on a bank check. Such as nine hundred seventy four thousand and 55 cents.

guomo avatar Apr 12 '20 18:04 guomo

@Wol, with impliedHundreds set to false, i am getting the below translated wrong:

thirty five thousand is coming back as 5030 forty three thousand as 3040

This is pretty standard expression all over the world. What do you think? Will file a new issue, as this seems fundamental

vnaganathan-conga avatar Feb 03 '21 08:02 vnaganathan-conga