senti-beta / frontend /src /components /ui /FinancialNumber.jsx
joseph njoroge kariuki
Deploy Senti AI to Hugging Face Spaces
021e065
Raw
History Blame Contribute Delete
468 Bytes
export function FinancialNumber({ amount, currency = "KES", positive = null }) {
const formatted = new Intl.NumberFormat('en-KE', {
minimumFractionDigits: 0,
maximumFractionDigits: 0
}).format(Math.abs(amount))
const isPositive = positive !== null ? positive : amount >= 0
return (
<span className={`
font-mono text-inherit
${isPositive ? 'text-emerald-600' : 'text-red-500'}
`}>
{currency} {formatted}
</span>
)
}