fix: remove incorrect /100 division in notification email currency formatting#19
Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Open
Conversation
The NotificationRenderer.FormatCurrency method incorrectly divided the amount by 100, assuming TotalAmount was transmitted in cents. However, the OrderPlacedEvent.TotalAmount is already in dollars (decimal), so the division produced wrong values (e.g., $149.99 became $1.50). Removed the erroneous division and the misleading comment.
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
NotificationRenderer.FormatCurrencydivided the incoming amount by 100, based on a comment claimingOrderPlacedEvent.TotalAmountis transmitted in cents. However, theOrderPlacedEventcontract (Shared.Contracts) definesTotalAmountas adecimalrepresenting dollars, and the HTTP ingestion endpoint passes the value through without conversion. This caused a $149.99 order to display as $1.50 in email previews.The fix removes the
/100mdivision and the misleading comment, so the amount is formatted directly.Before → After:
Review & Testing Checklist for Human
OrderPlacedEvent.{"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-placedand confirm the preview shows $149.99.Notes
ToString("C2")uses the server's current culture for the currency symbol. In containers with invariant culture this renders as¤rather than$. This is pre-existing behavior, not introduced by this PR.FormatCurrency. Consider adding tests to prevent regressions.Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/b345b1d1ea4b44ad8079221c41661d6b
Requested by: @akihiro-yamaguchi_dxc