π―
Float-safe by design
All values are stored as minor-unit integers internally. No floating-point rounding errors β ever.
Immutable, float-safe, and tree-shakeable. Built on minor-unit integers.

import { from, sum, total } from '@eriveltondasilva/currency'
// Create
const price = from(19.99, 'BR')
price.format() // => 'R$ 19,99'
price.applyDiscount(10).format() // => 'R$ 17,99'
// Collect
sum([10, 20, 30], 'US').format() // => '$60.00'
// Business
const items = [
{ price: 9.99, quantity: 3 },
{ price: 4.99 },
]
total(items, 'US').format() // => '$34.96'