Skip to content

[MKT-846]:feat/new text for renewal#1958

Open
jaaaaavier wants to merge 3 commits into
masterfrom
feat/update-texts-for-annual-plan
Open

[MKT-846]:feat/new text for renewal#1958
jaaaaavier wants to merge 3 commits into
masterfrom
feat/update-texts-for-annual-plan

Conversation

@jaaaaavier
Copy link
Copy Markdown
Contributor

@jaaaaavier jaaaaavier commented May 14, 2026

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

  • Changes have been tested locally.
  • Unit tests have been written or updated as necessary.
  • The code adheres to the repository's coding standards.
  • Relevant documentation has been added or updated.
  • No new warnings or errors have been introduced.
  • SonarCloud issues have been reviewed and addressed.
  • QA Passed

Testing Process

Additional Notes

@jaaaaavier jaaaaavier self-assigned this May 14, 2026
@jaaaaavier jaaaaavier added the enhancement New feature or request label May 14, 2026
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 14, 2026

Deploying drive-web with  Cloudflare Pages  Cloudflare Pages

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

View logs

@sonarqubecloud
Copy link
Copy Markdown

@jaaaaavier jaaaaavier marked this pull request as ready for review May 15, 2026 13:17
@jaaaaavier jaaaaavier requested review from a team, CandelR, larryrider and xabg2 as code owners May 15, 2026 13:17
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');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants