forzagreen / n2words

Convert numerical numbers to written numbers, in 25+ languages.
MIT License
87 stars 22 forks source link

Fix issue with extra leading zeros if decimal portion had zeros in value #134

Closed TylerVigario closed 9 months ago

TylerVigario commented 9 months ago

As mentioned in #133, this fixes decimal values that include zeros that are not leading. I also added a test since this case had none. Please take a look below for an example of the fix.

// Before
n2words(' -12.606') === 'minus twelve point zero six hundred and six'
// After
n2words(' -12.606') === 'minus twelve point six hundred and six'