Fix order amount display: remove incorrect /100 division in FormatCurrency#12
Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Open
Conversation
…rency Root cause: NotificationRenderer.FormatCurrency() divided the amount by 100, assuming TotalAmount was in cents. However, OrderPlacedEvent.TotalAmount is already in dollars (e.g. 149.99). This caused 149.99/100 = 1.4999, which displayed as $1.50 instead of $149.99. Also fixes incorrect relative paths for Shared project references in the Notification.API.csproj (../../Shared -> ../../../Shared).
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 after the microservice decomposition. A
$149.99order was rendered as$1.50in the email preview.Root cause:
NotificationRenderer.FormatCurrency()divided the amount by 100, assumingOrderPlacedEvent.TotalAmountwas transmitted in cents. In reality,TotalAmountis already in dollars (the shared contractOrderPlacedEventdefines it asdecimalwith no cents convention). So149.99 / 100 = 1.4999→$1.50.Fix: Remove the erroneous
/ 100mdivision and format the amount directly.Also fixes incorrect relative paths for Shared project references in
Notification.API.csproj(../../Shared→../../../Shared), which prevented the project from building standalone outside the solution.Before / After
Review & Testing Checklist for Human
TotalAmountis indeed in dollars — if any producer sends cents, this fix would be wrong.../../Sharedpaths were wrong for standalone builds but may have been compensated by the solution-level build or DockerfileCOPYlayout. Confirm CI still resolves Shared project references correctly with the new../../../Sharedpaths./api/notification/events/order-placedwith{"orderId":"11111111-1111-1111-1111-111111111111","customerId":"22222222-2222-2222-2222-222222222222","totalAmount":149.99,"placedAt":"2026-03-17T12:00:00Z"}, and verify the preview shows$149.99.Notes
View original video (rec-89ec476ec3d343e397607c18529a2fc9-edited.mp4)
FormatCurrency; consider adding one to prevent regression.Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/b9846a81daa84299a1bd483c23469e4e