Skip to content

feat(currency): add basis-points conversion and minor-unit raw string utilities - #619

Open
sharma0vineet wants to merge 2 commits into
masterfrom
feat/currency-basispoints-and-minor-unit-raw-string
Open

sharma0vineet wants to merge 2 commits into
masterfrom
feat/currency-basispoints-and-minor-unit-raw-string

Conversation

@sharma0vineet

Copy link
Copy Markdown
Member

Summary

  • convertBasisPointsToPercent(bps) — converts basis points to a percentage (250 → 2.5); inverse via convertPercentToBasisPoints(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 boundaries

All three are implemented in both i18nify-js and i18nify-go with full unit test coverage.

Changes

Package Files added
i18nify-js convertBasisPointsToPercent.ts, convertPercentToBasisPoints.ts, getMinorUnitRawString.ts + tests
i18nify-go convert_basis_points.go, get_minor_unit_raw_string.go + tests
changeset minor bump for @razorpay/i18nify-js

Test plan

  • yarn workspace @razorpay/i18nify-js run test — all 578 tests pass
  • cd packages/i18nify-go && go test ./modules/currency/... — all tests pass
  • yarn workspace @razorpay/i18nify-js run validate — tsc + lint clean

🤖 Generated with Claude Code

… 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-bot

changeset-bot Bot commented Apr 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9425e2c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@razorpay/i18nify-js Minor
@razorpay/i18nify-react Major

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

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Unit Test Results

0 files  ±0  0 suites  ±0   0s ⏱️ ±0s
0 tests ±0  0 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 9425e2c. ± Comparison against base commit c3b70d7.

@rzpcibot

rzpcibot commented Apr 14, 2026

Copy link
Copy Markdown
Contributor
Fails
🚫 🕵 Whoops, I don't see any reviewers. Remember to add one.

Bundle Size Report

Files

click to expand/collapse
🟢 No Change 🗑 File Deleted 🆕 New File 📈 Size Increased 👍 Size Reduced
Parsed (kb)
🚦 File Name Base PR Diff %
📈 cjs/index.js 180.93 183.9 $\textcolor{red}{2.97}$ 1.64
📈 esm/index.min.js 67.5 68.36 $\textcolor{red}{0.86}$ 1.27
📈 umd/index.js 204.08 207.29 $\textcolor{red}{3.21}$ 1.57

Generated by 🚫 dangerJS against 9425e2c

This branch has not been deployed

No deployments
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.

2 participants