🐛 Bug Fixes
- Correctness:
Ordinal(math.MinInt, …)no longer stack-overflows — same magnitude-via-uint64pattern the cardinal path already uses. #19 @rekurt - Input robustness:
DecimalToWordsandDecimalToWordsPrecisionnow accept leading/trailing whitespace uniformly (previously crashedstrconv.Atoiwith "invalid syntax"). #20 @rekurt - API consistency:
MoneyFromString("-0.xx", …)preserves the minus sign (previously silently dropped it, producing "ноль рублей пятьдесят копеек" for "-0.50"). #21 @rekurt - Silent correctness:
DecimalValueToWordsnow returnsErrNumberTooLargefor inputs whose whole part overflowsint64. Previously the guard was a 64-bit tautology and the function silently rendered wrappedint64bits as a valid-looking-but-wrong phrase. #22 @rekurt
⚡ Performance
convertPositiveUint64ToWordsreplaced O(triads²) prepend with preallocated linear append + in-place reverse. Apple M1 Pro: −23% allocs, −14% time onmath.MaxInt. Scales better for duodecillion-range inputs. #23 @rekurt
📚 Documentation
- Added runnable godoc
Example*functions forOrdinal,Money,MoneyFromString,DecimalToWordsPrecision— v0.4.0 shipped these APIs but pkg.go.dev showed no runnable examples until now. #24 @rekurt
🧪 Tests & CI
- Added README consistency checks: AST walks the package and asserts every exported declaration appears in both
README.mdandREADME_EN.md, plus a##/###parity check between RU and EN. Runs as a regular Go test — no workflow changes. #18 @rekurt - Added
govulncheckstep (pinnedv1.1.4) to the lint job. Current master is clean: 0 reachable vulnerabilities. #25 @rekurt
Full Changelog: v0.4.0...v0.4.1