Skip to content

Conversation

@hckhanh
Copy link
Owner

@hckhanh hckhanh commented Nov 4, 2025

Description

This pull request includes the following changes:

  1. Adjust changeset config and package workspaces:

    • Updated the changeset configuration to ignore the docs directory, preventing unnecessary change tracking.
    • Added . as a workspace in package.json for better package management.
  2. Improve readability of readVnNumber function:

    • Simplified string conversion logic, enhancing code clarity and maintainability.
  3. Handle large numeral groups in Vietnamese numeral logic:

    • Enhanced logic to repeat "tỷ" based on group position dynamically, ensuring accurate representation for large numbers such as billions, octillions, and undecillions.
    • Added new test cases to verify the updates and cover edge scenarios.

Checklist

  • I have written necessary tests for my code.
  • I have updated the documentation where relevant.

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.
Copilot AI review requested due to automatic review settings November 4, 2025 03:21
@hckhanh hckhanh self-assigned this Nov 4, 2025
@codecov-commenter
Copy link

codecov-commenter commented Nov 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (e484cd6) to head (8aae7a6).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

Copilot AI left a 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 getUnitSuffix to dynamically generate repeated "tỷ" suffixes based on position (e.g., "tỷ tỷ tỷ" for octillions)
  • Simplified string conversion in readVnNumber from number.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-hq
Copy link

codspeed-hq bot commented Nov 4, 2025

CodSpeed Performance Report

Merging #51 will improve performances by ×2.5

Comparing fix-billion (8aae7a6) with main (8d64884)

Summary

⚡ 1 improvement
✅ 63 untouched

Benchmarks breakdown

Benchmark BASE HEAD Change
mixed input types in data processing (30 values) 613.6 µs 245 µs ×2.5

Copy link
Contributor

Copilot AI commented Nov 4, 2025

@hckhanh I've opened a new pull request, #53, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Nov 4, 2025

@hckhanh I've opened a new pull request, #56, to work on those changes. Once the pull request is ready, I'll request review from you.

* 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]>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 4, 2025

@hckhanh hckhanh merged commit e9b3f15 into main Nov 4, 2025
7 checks passed
@hckhanh hckhanh deleted the fix-billion branch November 4, 2025 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants