Round an amount to 2 decimals so equality checks (dedup) aren't defeated by floating-point noise.
The amount to round.
The amount rounded to 2 decimal places.
round2(19.990000001); // 19.99 Copy
round2(19.990000001); // 19.99
export function round2(amount: number): number { return Number(amount.toFixed(2));} Copy
export function round2(amount: number): number { return Number(amount.toFixed(2));}
Round an amount to 2 decimals so equality checks (dedup) aren't defeated by floating-point noise.