yamadapc / js-written-number

Convert numbers to words - their written form
https://yamadapc.github.io/js-written-number
MIT License
367 stars 124 forks source link

Incorrect written number for hundred numbers without trailing numbers in Spanish #72

Closed pexposito closed 3 years ago

pexposito commented 4 years ago

For:

writtenNumber(1101, { lang: "es" })
\\ it returns "mil ciento uno" -> CORRECT

for:

writtenNumber(1100, { lang: "es" })
\\ it returns "mil ciento" -> INCORRECT
\\ it should be "mil cien"

The solution is to modify the first unit for "es.json" language file to add "useBaseExceptionWhenNoTrailingNumbers" property:

{
      "singular": "ciento",
      "useBaseInstead": true,
      "useBaseException": [1],
      "useBaseExceptionWhenNoTrailingNumbers": true
}
pexposito commented 4 years ago

I've created a PR for this issue. https://github.com/yamadapc/js-written-number/pull/73 Cheers!!!

yamadapc commented 3 years ago

Fixed as of v0.11.1, thanks