Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<ItemGroup>
<ProjectReference Include="..\Notification.Domain\Notification.Domain.csproj" />
<ProjectReference Include="..\Notification.Infrastructure\Notification.Infrastructure.csproj" />
<ProjectReference Include="..\..\Shared\Shared.Contracts\Shared.Contracts.csproj" />
<ProjectReference Include="..\..\Shared\Shared.Infrastructure\Shared.Infrastructure.csproj" />
<ProjectReference Include="..\..\..\Shared\Shared.Contracts\Shared.Contracts.csproj" />
<ProjectReference Include="..\..\..\Shared\Shared.Infrastructure\Shared.Infrastructure.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.*" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ public class NotificationRenderer
/// </summary>
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 already in dollars (decimal).
// Format directly as currency for display.
return amount.ToString("C2");
}

public string RenderOrderConfirmation(OrderNotification notification)
Expand Down