export function formatReceiptRecognitionScore(value) {
  const score = Number(value || 0)
  if (!Number.isFinite(score) || score <= 0) return '待确认'
  return `${Math.round(score * 100)}%`
}

export function formatReceiptDateTime(value) {
  if (!String(value ?? '').trim()) return '待确认'
  const date = new Date(value)
  if (Number.isNaN(date.getTime())) return '待确认'
  return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')} ${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}`
}
