Open this example in the interactive library
Source code
// app/[lang]/page.tsx
export default async function RegionalPriceDisplay({
params,
}: {
params: Promise<{ lang: string }>;
}) {
const { lang } = await params;
const locale = lang === "fr" ? "fr-CA" : "en-CA";
return (
<p>
{new Intl.NumberFormat(locale, { style: "currency", currency: "CAD" }).format(
24.5,
)}
</p>
);
}
