```ts
export function doseTotals(log: [string, string][]): Record<string, string> {
  const totals: Record<string, number> = {};

  for (const [reagent, amount] of log) {
    if (!/^-?\d+(\.\d{1,3})?$/.test(amount)) {
      throw new Error('Invalid amount format');
    }

    const ml = parseFloat(amount);
    totals[reagent] = (totals[reagent] || 0) + ml;
  }

  return Object.fromEntries(
    Object.entries(totals).map(([reagent, total]) => [
      reagent,
      total.toFixed(Math.max(...log.filter(([r]) => r === reagent).map(([_, a]) => (a.includes('.') ? a.split('.')[1].length : 0)))),
    ])
  );
}
```