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

jqueguiner / num2words2 / 25215226920
95%
master: 94%

Build:
Build:
LAST BUILD BRANCH: feat/sentence-multilang-ordinals
DEFAULT BRANCH: master
Ran 01 May 2026 01:03PM UTC
Jobs 6
Files 333
Run time 1min
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.181%
25215226920

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 %.

211 of 214 new or added lines in 4 files covered. (98.6%)

1 existing line in 1 file now uncovered.

41870 of 43582 relevant lines covered (96.07%)

5.76 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
87.54
5.55% num2words2/lang_TR.py
1
94.85
0.0% tests/lang/test_tr.py
1
98.93
tests/test_coverage_tr_sl.py

Coverage Regressions

Lines Coverage ∆ File
1
87.54
5.55% num2words2/lang_TR.py
Jobs
ID Job ID Ran Files Coverage
1 3.13 - 25215226920.1 01 May 2026 01:04PM UTC 333
95.28
GitHub Action Run
2 3.12 - 25215226920.2 01 May 2026 01:04PM UTC 333
95.28
GitHub Action Run
3 3.15 - 25215226920.3 01 May 2026 01:04PM UTC 333
95.28
GitHub Action Run
4 3.14 - 25215226920.4 01 May 2026 01:04PM UTC 333
95.28
GitHub Action Run
5 3.11 - 25215226920.5 01 May 2026 01:04PM UTC 333
95.28
GitHub Action Run
6 3.10 - 25215226920.6 01 May 2026 01:04PM UTC 333
95.28
GitHub Action Run
Source Files on build 25215226920
  • 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 Repo
  • ed8341db on github
  • Prev Build on main (#25214545615)
  • Next Build on main (#25217502610)
  • 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