Fix incorrect currency formatting in notification emails ($149.99 displayed as $1.50)#17
Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Conversation
Root cause: FormatCurrency() was dividing the amount by 100, assuming TotalAmount was transmitted in cents. However, the OrderPlacedEvent shared contract defines TotalAmount as a decimal in dollars (e.g. 149.99). The erroneous division converted $149.99 to $1.50 in email previews. Fix: Remove the /100 division since the amount is already in dollars.
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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
Order confirmation notification emails displayed incorrect amounts (e.g. a $149.99 order showed as $1.50).
Root cause:
FormatCurrency()inNotificationRenderer.csdivided the amount by 100, based on a stale comment claimingTotalAmountwas transmitted in cents. In reality, theOrderPlacedEventshared contract definesTotalAmountas adecimalin dollars. The division converted $149.99 → $1.4999 → $1.50.Fix: Remove the erroneous
/ 100mdivision so the dollar amount is formatted directly.Before / After
Recording: Reproduction and fix verification walkthrough:
View original video (rec-26d7d7d3290a474f816e42e5881d0dd8-edited.mp4)
Review & Testing Checklist for Human
TotalAmountin cents. The stale comment ("transmitted in cents") may reflect a previous contract version. Check the Order service and any other event publishers to confirm they populateTotalAmountas dollars, not cents. If any producer does send cents, this fix would break that flow.{"orderId": "11111111-1111-1111-1111-111111111111", "customerId": "22222222-2222-2222-2222-222222222222", "totalAmount": 149.99, "placedAt": "2026-03-17T12:00:00Z"}to/api/notification/events/order-placed, and confirm the preview shows $149.99.FormatCurrencyto guard against regression, since the misleading comment made this bug easy to introduce in the first place.Notes
ToString("C2")uses the server's current culture for currency symbol/formatting — this was already the case before the fix and is unchanged.Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/dcf4839f61324e4499cd8f2019a0ae86