export function formatBytes(bytes) {
  if (bytes === null || bytes === undefined) return "-";
  const gb = bytes / 1024 / 1024 / 1024;
  if (!isFinite(gb)) return "-";
  return `${gb.toFixed(0)} GB`;
}

export function formatPrice(price) {
  try {
    return Number(price || 0).toLocaleString("fa-IR");
  } catch {
    return price;
  }
}

export function formatDate(iso) {
  if (!iso) return "-";
  try {
    return new Date(iso).toLocaleString("fa-IR");
  } catch {
    return iso;
  }
}
