From 2f163121f526a5d2b4bf9cffeddd2aba2a48c761 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 7 Apr 2026 06:28:30 +0000 Subject: [PATCH] Fix incorrect currency formatting in notification emails 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. --- .../Notification.API/Services/NotificationRenderer.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Services/Notification/Notification.API/Services/NotificationRenderer.cs b/src/Services/Notification/Notification.API/Services/NotificationRenderer.cs index ac8d79e..0c470d8 100644 --- a/src/Services/Notification/Notification.API/Services/NotificationRenderer.cs +++ b/src/Services/Notification/Notification.API/Services/NotificationRenderer.cs @@ -16,11 +16,9 @@ public class NotificationRenderer /// private static string FormatCurrency(decimal amount) { - // The OrderPlacedEvent.TotalAmount is transmitted in cents (integer - // representation) to avoid floating-point precision issues across - // service boundaries. Convert back to dollars for display. - var dollars = amount / 100m; - return dollars.ToString("C2"); + // The OrderPlacedEvent.TotalAmount is transmitted in dollars (decimal) + // as defined in the shared contract. Format directly for display. + return amount.ToString("C2"); } public string RenderOrderConfirmation(OrderNotification notification)