Skip to content

Conversation

@prschulz
Copy link
Contributor

@prschulz prschulz commented Jan 8, 2026

Got some code for us? Awesome 🎊!

Please take a minute to explain the change you're making:

  • Why are you making it?
  • What does it do?
  • Why is this something Ghost users or developers need?

Why are you making it?
This change addresses inconsistent currency formatting for offer prices and discounts across the Ghost frontend (Portal) and admin panel (Admin-X-Settings). Previously, currency values were sometimes missing trailing zeros, currency symbols, or were not formatted as proper currency amounts (e.g., $1.2 instead of $1.20, or 1.2 USD instead of $1.20). The goal is to ensure consistent, proper currency formatting, where whole dollar amounts (e.g., $5) do not show trailing zeros, but amounts with cents (e.g., $1.20) do.

What does it do?
This PR introduces a new formatCurrency helper function in both apps/portal and apps/admin-x-settings. This function intelligently formats currency amounts:

  • Displays 2 decimal places for amounts with fractional cents (e.g., $1.20, $1.50).
  • Displays 0 decimal places for whole dollar amounts (e.g., $5, $10).
  • Ensures proper currency symbols are used.
    All relevant offer-related UI components (offer checkout page, offer discount tags, offer list, offer overview cards) have been updated to utilize this new consistent formatting logic.

Why is this something Ghost users or developers need?
For Ghost users (members and admins): Provides a more professional and trustworthy experience by ensuring all offer-related currency displays are accurate, consistent, and easy to read, matching standard currency conventions.
For Ghost developers: Establishes a centralized and robust utility for currency formatting, reducing the likelihood of future inconsistencies and simplifying currency display logic.

Please check your PR against these items:

  • I've read and followed the Contributor Guide
  • I've explained my change
  • I've written an automated test to prove my change works

We appreciate your contribution! 🙏


Linear Issue: DES-1268

Open in Cursor Open in Web

Introduces a new `formatCurrency` utility to standardize how currency amounts are displayed across the application, ensuring correct decimal places and currency symbols.

Co-authored-by: peter <[email protected]>
@cursor
Copy link

cursor bot commented Jan 8, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 8, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

3 participants