<commit_before>"use strict";

function accumulateStats(data) {
    var c_acc = 0,
        e_acc = 0,
        t_acc = 0;
    for (var i = 0; i < data.length; i++) {
        c_acc += data[i].c;
        e_acc += data[i].e;
        t_acc += data[i].t;
    }
    return {
        c: c_acc,
        e: e_acc,
        t: t_acc
    }
}

function populateStatsOdometers(data) {
    $("#oDonations").text(data[data.length - 1].m);
    $("#oDonators").text(data[data.length - 1].d);
    $("#oViewers").text(data[data.length - 1].v);
    var acc_stats = accumulateStats(data)
    $("#oChats").text(acc_stats.c);
    $("#oEmotes").text(acc_stats.e);
    $("#oTweets").text(acc_stats.t);
}

DBConnection.timeseriesListeners.push(populateStatsOdometers)
DBConnection.getTimeseries().then(function(data){
    populateStatsOdometers(data)
})

function populateGamesOdometer(data) {
    var num_completed = 0,
        i = 0,<commit_msg>Fix donation total formatting<commit_after>"use strict";

function accumulateStats(data) {
    var c_acc = 0,
        e_acc = 0,
        t_acc = 0;
    for (var i = 0; i < data.length; i++) {
        c_acc += data[i].c;
        e_acc += data[i].e;
        t_acc += data[i].t;
    }
    return {
        c: c_acc,
        e: e_acc,
        t: t_acc
    }
}

function populateStatsOdometers(data) {
    var donations = data[data.length - 1].m.toFixed(2);
    $("#oDonations").text(donations);
    $("#oDonators").text(data[data.length - 1].d);
    $("#oViewers").text(data[data.length - 1].v);
    var acc_stats = accumulateStats(data)
    $("#oChats").text(acc_stats.c);
    $("#oEmotes").text(acc_stats.e);
    $("#oTweets").text(acc_stats.t);
}

DBConnection.timeseriesListeners.push(populateStatsOdometers)
DBConnection.getTimeseries().then(function(data){
    populateStatsOdometers(data)
})

function populateGamesOdometer(data) {
    var num_completed = 0,
        i = 0,
{'fraction_non_alphanumeric': 0.17159450897571277, 'fraction_numerical': 0.01003167898627244, 'mean_word_length': 2.9072164948453607, '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': '4347186', 'n_tokens_mistral': 722, 'n_tokens_neox': 704, 'n_words': 115}