-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add unit tests for the BAHTTEXT formula function #2148
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
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
Adds Thai baht text conversion and broadens DOLLAR formatting tests across cultures
- Implements
BAHTTEXT
logic and Thai digit/unit mappings incalc.go
- Adds
TestBAHTTEXT
andTestDOLLAR
incalc_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)
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.
Thanks for your PR. Some expected value in the unit test case is incorrect, the implement in the PR #2187 returns the right results.
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.
I revert changes for formula function implementation, and add unit tests for based on your branch.
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
PR Details
Description
Related Issue
Motivation and Context
How Has This Been Tested
Types of changes
Checklist