export function formatRate(value, emptyText = '-') {
  if (value === null || value === undefined || value === '') {
    return emptyText
  }
  const stringValue = String(value).trim()
  if (stringValue === '') {
    return emptyText
  }
  const numberValue = Number(stringValue)
  if (Number.isNaN(numberValue)) {
    return stringValue
  }
  return numberValue.toFixed(2)
}
