import { useState } from "react" import { CurrencyInput } from "@medusajs/ui" export default function CurrencyInputControlled() { const [value, setValue] = useState("") const formatValue = (val: string | undefined) => { if (!val) { return "" } return new Intl.NumberFormat("en-US", { style: "currency", currency: "USD", }).format(parseFloat(val)) } return (
Value: {formatValue(value)}
) }