export function numberValue(value) {
  const number = Number(value);
  return Number.isFinite(number) ? number : 0;
}

export function ratio(numerator, denominator) {
  const den = numberValue(denominator);
  return den > 0 ? numberValue(numerator) / den : 0;
}
