feat(currency): add basis-points conversion and minor-unit raw string utilities - #619
Open
sharma0vineet wants to merge 2 commits into
Open
sharma0vineet wants to merge 2 commits into
sharma0vineet wants to merge 2 commits into
Conversation
… utilities - convertBasisPointsToPercent / convertPercentToBasisPoints: pure numeric helpers for fee/pricing boundaries (250 bps ↔ 2.50%) - getMinorUnitRawString: returns minor-unit amount as a plain integer string with no locale formatting, symbol, or grouping separators — intended for proto/XML protocol boundaries Both utilities are implemented in i18nify-js (wrapped with withErrorBoundary) and i18nify-go (returning idiomatic (value, error) pairs). Full unit test coverage in both packages. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 9425e2c The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This comment has been minimized.
This comment has been minimized.
Contributor
Contributor
Bundle Size Report
|
|||||||||||||||||||||||||||||||||||||||
| 🟢 No Change | 🗑 File Deleted | 🆕 New File | 📈 Size Increased | 👍 Size Reduced |
|---|
| Parsed (kb) | |||||
|---|---|---|---|---|---|
| 🚦 | File Name | Base | PR | Diff | % |
| 📈 | cjs/index.js |
180.93 |
183.9 |
|
1.64 |
| 📈 | esm/index.min.js |
67.5 |
68.36 |
|
1.27 |
| 📈 | umd/index.js |
204.08 |
207.29 |
|
1.57 |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
convertBasisPointsToPercent(bps)— converts basis points to a percentage (250 → 2.5); inverse viaconvertPercentToBasisPoints(pct)getMinorUnitRawString(amount, { currency })— returns the minor-unit amount as a plain integer string (100 USD → "10000"), with no locale formatting, symbol, or grouping separators — for proto/XML protocol boundariesAll three are implemented in both i18nify-js and i18nify-go with full unit test coverage.
Changes
i18nify-jsconvertBasisPointsToPercent.ts,convertPercentToBasisPoints.ts,getMinorUnitRawString.ts+ testsi18nify-goconvert_basis_points.go,get_minor_unit_raw_string.go+ testsminorbump for@razorpay/i18nify-jsTest plan
yarn workspace @razorpay/i18nify-js run test— all 578 tests passcd packages/i18nify-go && go test ./modules/currency/...— all tests passyarn workspace @razorpay/i18nify-js run validate— tsc + lint clean🤖 Generated with Claude Code