import { QuestionStatChoicesStat, TransformedChoicesStats } from '../../types';

export const formatChoiceStat = (
  stat: QuestionStatChoicesStat,
  idx: number,
): TransformedChoicesStats => ({
  ...stat,
  value: Math.round(stat.percentage),
  idx,
});
