```ts
export function parseAmount(text: string): number {
  const match = text.match(/^\d+(\.\d{2})?$/);
  if (match) {
    return Math.round(Number(match[0]) * 100);
  } else {
    throw new Error("Invalid amount format");
  }
}

export function formatAmount(cents: number): string {
  const dollars = Math.floor(cents / 100);
  const centsPart = (cents % 100).toString().padStart(2, '0');
  return `${dollars}.${centsPart}`;
}

export function allocateCents(totalCents: number, weights: number[]): number[] {
  if (weights.length === 0) {
    throw new Error("Empty weight list");
  }

  for (const weight of weights) {
    if (!Number.isInteger(weight) || weight < 0) {
      throw new Error("Invalid weight");
    }
  }

  const totalWeight = weights.reduce((sum, weight) => sum + weight, 0);
  if (totalWeight === 0) {
    throw new Error("Weights sum to zero");
  }

  if (!Number.isInteger(totalCents) || totalCents < 0) {
    throw new Error("Invalid total cents");
  }

  const proportionalValues = weights.map(weight => Math.floor((weight / totalWeight) * totalCents));
  let remainder = totalCents - proportionalValues.reduce((sum, value) => sum + value, 0);

  for (let i = 0; i < remainder; i++) {
    proportionalValues[weights.findIndex(w => w === Math.max(...weights))] += 1;
  }

  return proportionalValues;
}
```