```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 millilitres = parseFloat(amount);
    totals[reagent] = (totals[reagent] || 0) + millilitres;
  }

  return Object.entries(totals).reduce((acc, [reagent, total]) => {
    acc[reagent] = total.toFixed(total.toString().split('.')[1]?.length || 0);
    return acc;
  }, {} as Record<string, string>);
}
```