[MKT-846]:feat/new text for renewal#1958
Open
jaaaaavier wants to merge 3 commits into
Open
Conversation
Deploying drive-web with
|
| Latest commit: |
cd9e646
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://6c6bd4c0.drive-web.pages.dev |
| Branch Preview URL: | https://feat-update-texts-for-annual.drive-web.pages.dev |
|
xabg2
reviewed
May 15, 2026
| describe('Calculating final price of a product', () => { | ||
| it('When there is no coupon, returns base amount multiplied by users', () => { | ||
| expect(getProductAmount(10, 2)).toBe('20'); | ||
| expect(getProductAmount(10, 2)).toBe('20.00'); |
Contributor
There was a problem hiding this comment.
Do we want to introduce decimals when they are 00? Is this approved from product? I recall last time I had to remove them if they were .00.
| export const formatPrice = (price: number) => { | ||
| const formattedAmount = Number(price.toFixed(2)); | ||
| return Number.isInteger(formattedAmount) ? formattedAmount.toString() : price.toFixed(2); | ||
| const truncated = Math.floor(Number(price.toFixed(8)) * 100) / 100; |
Contributor
There was a problem hiding this comment.
Why are we using toFixed(8) here? It looks arbitrary and makes the intent unclear.
If the goal is simply truncating to 2 decimals, Math.floor(price * 100) / 100 should be enough.
If this is a workaround for floating-point precision issues, it would be good to document it explicitly or use a more deterministic decimal handling approach.
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.



Description
This PR introduces a change to the text displayed in annual plans regarding the renewal rate. Since we now offer a discount on monthly plans, we should display the current price and specify that it renews at price X.
Related Issues
Related Pull Requests
Checklist
Testing Process
Additional Notes