<commit_before>var m = require('mithril');
var game = require('game').game;

function prefixInteger(num, length) {
  return (num / Math.pow(10, length)).toFixed(length).substr(2);
}

function bold(x) {
  return '<b>' + x + '</b>';
}

var sepHigh = '<seph>:</seph>';
var sepLow = '<sepl>:</sepl>';

function formatClockTime(ctrl, time, running) {
  var date = new Date(time);
  var minutes = prefixInteger(date.getUTCMinutes(), 2);
  var secs = date.getSeconds();
  var seconds = prefixInteger(secs, 2);
  var tenths = Math.floor(date.getMilliseconds() / 100);
  var hundredths = function() {
    return Math.floor(date.getMilliseconds() / 10) - tenths * 10;
  };
  var sep = (running && tenths < 5) ? sepLow : sepHigh;
  if (ctrl.data.showTenths == 2 || (ctrl.data.showTenths == 1 && time < 10000)) {
    var showHundredths = !running && secs < 1;
    return bold(minutes) + sep + bold(seconds) +
      '<tenths><seph>.</seph>' + bold(tenths) + (showHundredths ? '<huns>' + hundredths() + '</huns>' : '') + '</tenths>';
  } else if (time >= 3600000) {
    var hours = prefixInteger(date.getUTCHours(), 2);
    return bold(hours) + sepHigh + bold(minutes) + sep + bold(seconds);
  } else {
    return bold(minutes) + sep + bold(seconds);
  }
}

function showBar(ctrl, time, berserk) {
  return ctrl.data.showBar ? m('div', {
    class: 'bar' + (berserk ? ' berserk' : '')
  }, m('span', {
    style: {
      width: Math.max(0, Math.min(100, (time / ctrl.data.barTime) * 100)) + '%'
    }
  })) : null;
}

module.exports = {<commit_msg>fix round clock when showing tenths and time > 1h<commit_after>var m = require('mithril');
var game = require('game').game;

function prefixInteger(num, length) {
  return (num / Math.pow(10, length)).toFixed(length).substr(2);
}

function bold(x) {
  return '<b>' + x + '</b>';
}

var sepHigh = '<seph>:</seph>';
var sepLow = '<sepl>:</sepl>';

function formatClockTime(ctrl, time, running) {
  var date = new Date(time);
  var minutes = prefixInteger(date.getUTCMinutes(), 2);
  var secs = date.getSeconds();
  var seconds = prefixInteger(secs, 2);
  var tenths = Math.floor(date.getMilliseconds() / 100);
  var hundredths = function() {
    return Math.floor(date.getMilliseconds() / 10) - tenths * 10;
  };
  var sep = (running && tenths < 5) ? sepLow : sepHigh;
  if ((ctrl.data.showTenths == 2 && time < 3600000) || (ctrl.data.showTenths == 1 && time < 10000)) {
    var showHundredths = !running && secs < 1;
    return bold(minutes) + sep + bold(seconds) +
      '<tenths><seph>.</seph>' + bold(tenths) + (showHundredths ? '<huns>' + hundredths() + '</huns>' : '') + '</tenths>';
  } else if (time >= 3600000) {
    var hours = prefixInteger(date.getUTCHours(), 2);
    return bold(hours) + sepHigh + bold(minutes) + sep + bold(seconds);
  } else {
    return bold(minutes) + sep + bold(seconds);
  }
}

function showBar(ctrl, time, berserk) {
  return ctrl.data.showBar ? m('div', {
    class: 'bar' + (berserk ? ' berserk' : '')
  }, m('span', {
    style: {
      width: Math.max(0, Math.min(100, (time / ctrl.data.barTime) * 100)) + '%'
    }
  })) : null;
}

module.exports = {
{'fraction_non_alphanumeric': 0.19526248399487836, 'fraction_numerical': 0.02560819462227913, 'mean_word_length': 3.6227810650887573, 'pattern_counts': {'":': 0, '<': 34, '<?xml version=': 0, '>': 30, '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': '4709151', 'n_tokens_mistral': 1203, 'n_tokens_neox': 1117, 'n_words': 262}