Skip to content

Commit e9b3f15

Browse files
hckhanhCopilot
andauthored
Fix Vietnamese numeral reading and optimize configuration (#51)
* Handle large number groups in Vietnamese numeral reading 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. * Simplified `readVnNumber` string conversion for improved readability * Adjust changeset config and package workspaces for docs Updated changeset configuration to ignore the `docs` directory, preventing unnecessary change tracking. Added `.` as a workspace in `package.json` to ensure proper package management. * Fix billion suffix logic and use new Array() Co-authored-by: hckhanh <[email protected]> * Revert billion suffix logic change due to performance regression (#56) * 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]> * Apply suggestion from @hckhanh * Apply suggestion from @hckhanh * Update README.md to enhance project description and badge visibility --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]>
1 parent 8d64884 commit e9b3f15

File tree

9 files changed

+9938
-9
lines changed

9 files changed

+9938
-9
lines changed

.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
"access": "restricted",
88
"baseBranch": "main",
99
"updateInternalDependencies": "patch",
10-
"ignore": []
10+
"ignore": ["docs"]
1111
}

.changeset/eighty-friends-film.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"vn-number": patch
3+
---
4+
5+
Simplified `readVnNumber` string conversion to improve performance

.changeset/tired-years-wink.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"vn-number": patch
3+
---
4+
5+
Fixed logic to repeat "tỷ" based on group position dynamically, ensuring accurate representation for billions, octillions, and undecillions.

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
# vn-number
1+
# 🇻🇳 vn-number [![NPM Downloads](https://img.shields.io/npm/dw/vn-number)](https://www.npmjs.com/package/vn-number) [![JSR](https://jsr.io/badges/@hckhanh/vn-number/weekly-downloads)](https://jsr.io/@hckhanh/vn-number)
22

3-
A bunch of utility functions that work with numbers in Vietnamese language.
3+
🛠 A bunch of utility functions that work with number in 🇻🇳 Vietnamese language
44

55
[![Publish](https://github.com/hckhanh/vn-number/actions/workflows/publish.yml/badge.svg)](https://github.com/hckhanh/vn-number/actions/workflows/publish.yml)
66
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=hckhanh_vn-number&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=hckhanh_vn-number)
7+
[![codecov](https://codecov.io/gh/hckhanh/vn-number/graph/badge.svg?token=UG10IM2LLW)](https://codecov.io/gh/hckhanh/vn-number)
78
[![CodSpeed Badge](https://img.shields.io/endpoint?url=https://codspeed.io/badge.json)](https://codspeed.io/hckhanh/vn-number?utm_source=badge)
8-
[![NPM Downloads](https://img.shields.io/npm/dw/vn-number)](https://www.npmjs.com/package/vn-number)
9-
[![JSR](https://jsr.io/badges/@hckhanh/vn-number/weekly-downloads)](https://jsr.io/@hckhanh/vn-number)
109

1110
## Features
1211

0 commit comments

Comments
 (0)