```ts
export function shortNum(value: number): string {
  if (value === null || value === undefined) throw new Error("Value cannot be null or undefined");
  if (!Number.isInteger(value)) throw new Error("Value must be an integer");

  const units = ["", "k", "m"];
  let result = `${Math.floor(value)}`;

  if (result.length > 3) {
    const decimalIndex = Math.max(0, result.length - 4);
    const roundedValue = parseFloat(result.slice(0, decimalIndex + 1)) / 10;
    result = `${roundedValue.toFixed(1)}${units[Math.floor(decimalIndex / 3)]}`;
  }

  return result;
}
```