keep cents in CBE bills and prices

This commit is contained in:
Marshal
2026-08-08 20:45:05 +00:00
parent aad9ebaf78
commit 80a14c176b
9 changed files with 65 additions and 34 deletions

View File

@@ -19,7 +19,10 @@ export function BookingPricingSummary({ booking }: { booking: BookingDetail }) {
const lineItems = booking.pricingBreakdown?.lineItems ?? [];
const fmt = (n: number) =>
`${booking.paymentCurrency} ${n.toLocaleString(undefined, { minimumFractionDigits: 2 })}`;
`${booking.paymentCurrency} ${n.toLocaleString(undefined, {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
})}`;
return (
<SectionCard icon={Banknote} title="Pricing & payment">
@@ -74,7 +77,11 @@ export function BookingPricingSummary({ booking }: { booking: BookingDetail }) {
{li.description}
</Text>
<Text size="sm" fw={600} style={{ fontVariantNumeric: "tabular-nums" }}>
{Number(li.amount).toLocaleString()} {li.currency}
{Number(li.amount).toLocaleString(undefined, {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
})}{" "}
{li.currency}
</Text>
</Group>
))}

View File

@@ -11,7 +11,10 @@ import { SectionCard } from "./SectionCard";
import { MetricTile } from "./MetricTile";
const money = (amount: number, currency: string) =>
`${Number(amount).toLocaleString()} ${currency === "ETB" ? "Birr (ETB)" : currency}`;
`${Number(amount).toLocaleString(undefined, {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
})} ${currency === "ETB" ? "Birr (ETB)" : currency}`;
/**
* Cargo costs (booking-level totals) plus the same truck-import block the