• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jqueguiner / num2words2 / 25215226920 / 1
95%
main: 95%

Build:
DEFAULT BRANCH: main
Ran 01 May 2026 01:04PM UTC
Files 333
Run time 7s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

01 May 2026 01:02PM UTC coverage: 95.281% (+0.1%) from 95.177%
25215226920.1

push

github

web-flow
fix(tr): natural-precision floats, ordinal_num apostrophe, Decimal input (#111)

Three correctness fixes for Turkish that made it into the same patch
because they're tangled in the same to_cardinal/to_ordinal_num path
and the existing tests had been encoding the buggy outputs.

1. Float reading at natural precision (savoirfairelinux/num2words#487)
   Previously num2words(0.1, lang='tr') padded to '0.10' and read it as
   "sıfır virgül on" (zero point ten). The natural Turkish reading is
   "sıfır virgül bir" (zero point one). The library was already doing
   digit-by-digit reading for 0.01 → "sıfır bir" — only single-digit
   fractions were over-padded. We now use the input's natural precision
   from Decimal(str(value)).as_tuple().exponent when self.precision is
   at the language default. Two-digit fractions (0.25 → "yirmi beş"),
   leading-zero fractions (0.01, 0.05), and explicit precision=
   overrides are all preserved.

2. to_ordinal_num apostrophe + correct suffix (savoirfairelinux/num2words#128)
   Standard Turkish (TDK) writes ordinals as digit + apostrophe + suffix
   matching the cardinal's vowel harmony AND its ending. Cardinals
   ending in a vowel take a 3-char suffix ("nci/ncı/ncu/ncü"); cardinals
   ending in a consonant take a 4-char suffix ("inci/ıncı/uncu/üncü").
   The previous implementation just took to_ordinal()[-4:] and dropped
   the apostrophe, producing "5inci" instead of "5'inci" and "2inci"
   instead of "2'nci". Now we recover the suffix by stripping the
   cardinal off the ordinal — robust under all vowel-harmony cases.

3. verify_cardinal accepts Decimal input (chained from #1)
   The historical `if not float(value) == value` check returned False
   for Decimal('0.1') because float(Decimal('0.1')) ≈ 0.1 ≠ Decimal('0.1')
   under IEEE 754. _to_cardinal_impl then short-circuited to "" instead
   of routing to to_cardinal_float. Removed that misnamed gate; we now
   only reject inputs that don't survive a float() probe.

... (continued)

7941 of 8696 branches covered (91.32%)

Branch coverage included in aggregate %.

41870 of 43582 relevant lines covered (96.07%)

0.96 hits per line

Source Files on job 3.13 - 25215226920.1
  • Tree
  • List 333
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 25215226920
  • ed8341db on github
  • Prev Job for on main (#25214545615.1)
  • Next Job for on main (#25217502610.2)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc