```typescript
export function sizeUnit(bytesCount: number): string {
  if (bytesCount < 0) {
    throw new Error("a byte count cannot be negative");
  }
  const unit = sizeUnit(bytesCount);
  if (unit === "B") {
    return String(bytesCount) + " B";
  }
  if (unit === "KB") {
    return String(Math.floor(bytesCount / 1024)) + " KB";
  }
  const remainder = bytesCount % (1024 * 1000);
  if (remainder === 0) {
    return String(Math.floor(bytesCount / (1024 * 1000))) + " MB";
  } else {
    return `${Math.floor(bytesCount / (1024 * 1000))} MB ${Math.ceil(remainder / 1024)} KB`;
  }
}

/** A byte count written in whole units. */
export function sizeText(bytesCount: number): string {
  if (bytesCount < 0) {
    throw new Error("a byte count cannot be negative");
  }
  const unit = sizeUnit(bytesCount);
  if (unit === "B") {
    return String(bytesCount) + " B";
  }
  if (unit === "KB") {
    return String(Math.floor(bytesCount / 1024)) + " KB";
  }
  const remainder = bytesCount % (1024 * 1000);
  if (remainder === 0) {
    return `${Math.floor(bytesCount / (1024 * 1000)))} MB`;
  } else {
    return `${Math.floor(bytesCount / (1024 * 1000))} MB ${Math.ceil(remainder / 1024)} KB`;
  }
}
```