Skip to content
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

fix: 全角英数を半角英数に置き換える #6

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

nandenjin
Copy link
Member

@nandenjin nandenjin commented Jan 23, 2025

Fixes #5

Add functionality to replace full-width alphanumeric characters with half-width ones in specified fields.

  • src/lib/string.ts: Add a utility function replaceFullWidthWithHalfWidth to replace full-width alphanumeric characters with half-width ones.
  • src/store/data.ts: Import replaceFullWidthWithHalfWidth from src/lib/string.ts. Update the transactions computed property to use replaceFullWidthWithHalfWidth for the specified fields: receipt number and total number of nights stayed.

For more details, open the Copilot Workspace session.

Fixes #5

Add functionality to replace full-width alphanumeric characters with half-width ones in specified fields.

* **src/lib/string.ts**: Add a utility function `replaceFullWidthWithHalfWidth` to replace full-width alphanumeric characters with half-width ones.
* **src/store/data.ts**: Import `replaceFullWidthWithHalfWidth` from `src/lib/string.ts`. Update the `transactions` computed property to use `replaceFullWidthWithHalfWidth` for the specified fields: receipt number and total number of nights stayed.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/tsukuba-neu/sawagani/issues/5?shareId=XXXX-XXXX-XXXX-XXXX).
@nandenjin nandenjin requested a review from Copilot January 23, 2025 09:07
@nandenjin nandenjin self-assigned this Jan 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

src/store/data.ts:120

  • Ensure that the new behavior of replacing full-width alphanumeric characters with half-width ones in the 'receipt' field is covered by tests.
receipt: replaceFullWidthWithHalfWidth(row[header.indexOf('領収書No')]),

src/store/data.ts:125

  • Ensure that the new behavior of replacing full-width alphanumeric characters with half-width ones in the 'numStay' field is covered by tests.
numStay: replaceFullWidthWithHalfWidth(row[header.indexOf('延べ宿泊数')]),
@nandenjin nandenjin merged commit 298f7d5 into dev Jan 23, 2025
2 checks passed
@nandenjin nandenjin deleted the nandenjin/fix-fullwidth-conversion branch January 23, 2025 09:07
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.

全角数字が入力されると折り返し位置が変わる
1 participant