Skip to content

Conversation

zhuyanhuazhuyanhua
Copy link
Contributor

@zhuyanhuazhuyanhua zhuyanhuazhuyanhua commented May 28, 2025

PR Details

Description

Related Issue

Motivation and Context

How Has This Been Tested

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@xuri xuri added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 29, 2025
@xuri xuri requested a review from Copilot May 29, 2025 06:54
Copy link

@Copilot 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

Adds Thai baht text conversion and broadens DOLLAR formatting tests across cultures

  • Implements BAHTTEXT logic and Thai digit/unit mappings in calc.go
  • Adds TestBAHTTEXT and TestDOLLAR in calc_test.go covering zero, integer, decimal, large values, and multi‐culture scenarios

Reviewed Changes

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

File Description
calc.go Implemented numToThaiText, Thai digit/unit maps, and BAHTTEXT function
calc_test.go Imported fmt; added TestBAHTTEXT and TestDOLLAR test suites
Comments suppressed due to low confidence (1)

calc.go:18905

  • Consider adding a test case for inputs with more than two decimal places (e.g., 1.234) to verify intended rounding vs. truncation behavior.
decimalPart := int((num.Number - float64(integerPart)) * 100)

Copy link
Member

@xuri xuri left a comment

Choose a reason for hiding this comment

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

Thanks for your PR. Some expected value in the unit test case is incorrect, the implement in the PR #2187 returns the right results.

@xuri xuri added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 4, 2025
@xuri xuri moved this to Miscellaneous in Excelize v2.10.0 Sep 4, 2025
Copy link
Member

@xuri xuri left a comment

Choose a reason for hiding this comment

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

I revert changes for formula function implementation, and add unit tests for based on your branch.

@xuri xuri changed the title add BAHTTEXT and DOLLAR with their test files Add unit tests for the BAHTTEXT formula function Sep 4, 2025
Copy link

codecov bot commented Sep 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.24%. Comparing base (c95ba17) to head (0b0389a).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2148      +/-   ##
==========================================
+ Coverage   98.96%   99.24%   +0.28%     
==========================================
  Files          32       32              
  Lines       30724    30724              
==========================================
+ Hits        30406    30493      +87     
+ Misses        239      153      -86     
+ Partials       79       78       -1     
Flag Coverage Δ
unittests 99.24% <ø> (+0.28%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@xuri xuri merged commit aca2959 into qax-os:master Sep 4, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
Status: Miscellaneous
Development

Successfully merging this pull request may close these issues.

2 participants