🎉 init

This commit is contained in:
2026-07-01 15:43:18 +02:00
commit 2f492c55be
64 changed files with 11645 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
import { describe, expect, it } from 'vitest'
import { formatCurrency, fromCents, toCents } from './money'
describe('money helpers', () => {
it('converts amounts to cents', () => {
expect(toCents(12.34)).toBe(1234)
expect(toCents(5)).toBe(500)
})
it('converts cents back to amounts', () => {
expect(fromCents(1234)).toBe(12.34)
})
it('formats cents as a localized currency string', () => {
expect(formatCurrency(1234, 'EUR')).toContain('12')
expect(formatCurrency(1234, 'EUR')).toContain('34')
})
})