.claude/skills/multi-currency/SKILL.md
Currency settings and formatting for global users in LivestockAI
npx skillsauth add captjay98/gemini-livestockai Multi-CurrencyInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
LivestockAI supports multiple currencies with user-configurable settings.
| Currency | Symbol | Code | Regions | | --------------- | ------ | ---- | ------- | | Nigerian Naira | ₦ | NGN | Nigeria | | US Dollar | $ | USD | Global | | Euro | € | EUR | Europe | | British Pound | £ | GBP | UK | | Indian Rupee | ₹ | INR | India | | Kenyan Shilling | KSh | KES | Kenya |
Currency preference is stored in user_settings:
interface UserSettings {
currency: 'NGN' | 'USD' | 'EUR' | 'GBP' | 'INR' | 'KES'
dateFormat: 'DD/MM/YYYY' | 'MM/DD/YYYY' | 'YYYY-MM-DD'
weightUnit: 'kg' | 'lb'
language: 'en' | 'fr' | 'es' | 'pt' | 'sw' | 'ha'
}
import { useFormatCurrency } from '~/features/settings'
function PriceDisplay({ amount }: { amount: number }) {
const { format, formatCompact, symbol } = useFormatCurrency()
return (
<div>
<span>{format(amount)}</span> {/* ₦1,234.56 */}
<span>{formatCompact(amount)}</span> {/* ₦1.2K */}
<span>{symbol}</span> {/* ₦ */}
</div>
)
}
// app/features/settings/currency-presets.ts
export const CURRENCY_PRESETS = {
NGN: {
code: 'NGN',
symbol: '₦',
name: 'Nigerian Naira',
locale: 'en-NG',
decimals: 2,
},
USD: {
code: 'USD',
symbol: '$',
name: 'US Dollar',
locale: 'en-US',
decimals: 2,
},
// ...
}
// Format with user's currency setting
const { format } = useFormatCurrency()
format(1234.56) // "₦1,234.56"
// Compact format for large numbers
const { formatCompact } = useFormatCurrency()
formatCompact(1500000) // "₦1.5M"
// Get just the symbol
const { symbol } = useFormatCurrency()
// "₦"
All monetary values are stored as DECIMAL(19,2) without currency symbol:
// Store
await db.insertInto('sales').values({
totalAmount: toDbString(1234.56), // "1234.56"
})
// Display
const amount = toNumber(sale.totalAmount)
format(amount) // "₦1,234.56" (based on user settings)
financial-calculations - Decimal arithmetici18n-patterns - Locale-aware formattingdata-ai
Input validation patterns with Zod in LivestockAI server functions
testing
Unit testing patterns with Vitest in LivestockAI
tools
Server → Service → Repository pattern for feature organization
data-ai
Server-side rendering and server functions with TanStack Start in LivestockAI