<commit_before>'use strict';
export function percent (value, total, decimals = 2) {
  let val = value / total * 100;
  if (decimals === 0) {
    decimals = val < 1 ? 1 : 0;
  }
  return round(val, decimals);
}

export function round (value, decimals = 2) {
  return Math.round(value * Math.pow(10, decimals)) / Math.pow(10, decimals);
}<commit_msg>Fix round<commit_after>'use strict';
export function percent (value, total, decimals = 2) {
  let val = value / total * 100;
  return round(val, decimals);
}

export function round (value, decimals = 2) {
  if (decimals === 0) {
    decimals = value < 1 ? 1 : 0;
  }
  return Math.round(value * Math.pow(10, decimals)) / Math.pow(10, decimals);
}
{'fraction_non_alphanumeric': 0.15273775216138327, 'fraction_numerical': 0.037463976945244955, 'mean_word_length': 3.6333333333333333, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5695431', 'n_tokens_mistral': 276, 'n_tokens_neox': 238, 'n_words': 75}