function formatScore(num) {
  if (num) {
    const truncated = Math.trunc(num * 10) / 10;
    return truncated % 1 === 0 ? Math.trunc(truncated) : truncated;
  }
  return 0;
}

export default formatScore;
