-
Notifications
You must be signed in to change notification settings - Fork 1
Update Vietnamese numeral reading and optimize configuration #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Updated logic to repeat "tỷ" based on group position dynamically, ensuring accurate representation for billions, octillions, and undecillions. Added comprehensive test cases to validate the new functionality and edge cases.
Updated changeset configuration to ignore the `docs` directory, preventing unnecessary change tracking. Added `.` as a workspace in `package.json` to ensure proper package management.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #51 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 6 6
Lines 245 245
Branches 82 82
=========================================
Hits 245 245 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances support for very large numbers in Vietnamese number reading by dynamically repeating "tỷ" based on group position, and simplifies the string conversion logic in readVnNumber.
- Updated
getUnitSuffixto dynamically generate repeated "tỷ" suffixes based on position (e.g., "tỷ tỷ tỷ" for octillions) - Simplified string conversion in
readVnNumberfromnumber.toString()to'' + number - Added test coverage for octillions and undecillions
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/read/index.ts | Simplified number-to-string conversion using concatenation operator |
| src/read/groups.ts | Implemented dynamic "tỷ" repetition based on position for large numbers |
| src/read/index.test.ts | Added test cases for octillions and undecillions |
| package.json | Added current directory to workspaces array |
| .changeset/tired-years-wink.md | Changeset documenting the dynamic "tỷ" logic update |
| .changeset/eighty-friends-film.md | Changeset documenting the simplified string conversion |
| .changeset/config.json | Added "docs" to ignore list for changesets |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CodSpeed Performance ReportMerging #51 will improve performances by ×2.5Comparing Summary
Benchmarks breakdown
|
Co-authored-by: hckhanh <[email protected]>
* Initial plan * Clarify billion suffix logic consistency fix in Vietnamese number reading Co-authored-by: hckhanh <[email protected]> * Revert to original logic: use positionFromRight >= 6 for performance Co-authored-by: hckhanh <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: hckhanh <[email protected]>
|



Description
This pull request includes the following changes:
Adjust changeset config and package workspaces:
docsdirectory, preventing unnecessary change tracking..as a workspace inpackage.jsonfor better package management.Improve readability of
readVnNumberfunction:Handle large numeral groups in Vietnamese numeral logic:
Checklist