/** Rounds to `places` decimals, nudging past float error so 1.005 rounds to 1.01. */ export function round(value: number, places: number): number { const factor = 10 ** places; return Math.round((value + Math.sign(value) * Number.EPSILON) * factor) / factor; } export const round2 = (value: number) => round(value, 2);