Is there any way to set precision to all amounts?
AlbertoJALJ opened this issue · comments
José Alberto López Jiménez commented
Adel Ak commented
@AlbertoJALJ in a global way? Nop.
It's easy tho, just create your own re-useable solution
import currencyJs from "currency.js";
const currency = (
value: string | number | currencyJs,
opts?: currencyJs.Options | undefined
) => currencyJs(value, { ...opts, precision: opts?.precision || 0.2, });