words-to-numbers
words-to-numbers copied to clipboard
'twenty-one thousand five hundred seventy-six' => 1596
wrong conversion as in title
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 I wouldn't call that example a bug. Linguistically the and is in the wrong place if you meant to spell out 974,000.
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".
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.
@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