<commit_before>//-----------------------------------------------------------------------

function loadCard()
{
	function stringValueFormatter(startValue,changePerDay,unit,seconds)
	{
		return startValue+' '+unit;
	}

	function dateValueFormatter(startValue,changePerDay,unit,seconds)
	{
	}

	function euroValueFormatter(startValue,changePerDay,unit,seconds)
	{
		var value = startValue;
		if(0<changePerDay) {
			value = seconds*changePerDay/24/60/60;
		}

		if(value<1000) {
			value = parseInt(value*100);
			value = value.toString();
			while(value.length<3) {
				value = '0'+value;
			}
			value = value.substr(0,value.length-2)+','+value.substr(-2);
		} else {
			value = parseInt(value).toString();
			if(value.length>3) {
				value = value.substr(0,value.length-3)+'.'+value.substr(-3);
			}
			if(value.length>11) {
				value = parseInt(parseInt(value.substr(0,value.length-4))/1000000);
				value = value.toString();
				value = value+' Mrd ';
			} else if(value.length>10) {
				value = parseInt(parseInt(value.substr(0,value.length-4))/100000);
				value = value.toString();
				value = value.substr(0,value.length-1)+','+value.substr(-1)+' Mrd ';
			} else if(value.length>8) {
				value = parseInt(parseInt(value.substr(0,value.length-4))/1000);
				value = value.toString();
				value = value+' Mio ';
			} else if(value.length>7) {
				value = parseInt(parseInt(value.substr(0,value.length-4))/100);
				value = value.toString();
				value = value.substr(0,value.length-1)+','+value.substr(-1)+' Mio ';
			}
		}
		return value+' '+unit;
	}

	function createCard(data)
	{
		data = data || {};
		data.front = data.front || {};
		data.front.textTop = data.front.textTop || '';
		data.front.textButton = data.front.textButton || '';
		data.front.value = data.front.value || '';
		data.front.unit = data.front.unit || '';
		data.front.changePerDay = data.front.changePerDay || '';
		data.front.format = data.front.format || '';
		data.front.background = data.front.background || '';
		data.front.color = data.front.color || '';
		data.front.cssClass = data.front.cssClass || '';
		data.back = data.back || {};
		data.back.text = data.back.text || '';
		data.back.color = data.back.color || '';
		data.back.background = data.back.background || '';
		data.back.cssClass = data.back.cssClass || '';

		var value = data.front.value+' '+data.front.unit;
		var valueFormatter = stringValueFormatter;
		if('date'==data.front.format) {
			var d1 = new Date();
			var d2 = new Date(data.front.value);
			var diff = (d2-d1)/1000/60/60/24;
			if(diff<1) {
				value = '- Tage';
			} else if(diff<2) {
				value = '1 Tag';
			} else {
				value = parseInt(diff)+' Tage';
			}
		} else if('euro'==data.front.format) {
			valueFormatter = euroValueFormatter;
			value = valueFormatter(data.front.value,0,data.front.unit,0);
		}
		var front = data.front.textTop+'<br><span>'+value+'</span><br>'+data.front.textButton;
		var frontTextColor = 'color:'+data.front.color+';';
		var frontBGImage = data.front.background;
		var frontCSSClass = data.front.cssClass;
		var back = data.back.text;
		var backTextColor = 'color:'+data.back.color+';';
		var backBGImage = data.back.background;
		var backCSSClass = data.back.cssClass;
		var changePerDay = data.front.changePerDay;

		createNewCard({
			front:{text:front,image:frontBGImage,style:frontTextColor,css:frontCSSClass+' display'},
			back:{text:back,image:backBGImage,style:backTextColor,css:backCSSClass},
			data:{value:data.front.value,unit:data.front.unit,change:changePerDay,formatter:valueFormatter},
		});
	}

	if(config.loaded < config.cards.length) {
		var url = config.cards[config.loaded];<commit_msg>added intValueFormatter<commit_after>//-----------------------------------------------------------------------

function loadCard()
{
	function stringValueFormatter(startValue,changePerDay,unit,seconds)
	{
		return startValue+' '+unit;
	}

	function dateValueFormatter(startValue,changePerDay,unit,seconds)
	{
	}

	function intValueFormatter(startValue,changePerDay,unit,seconds)
	{
		var value = startValue;
		if(''==value) {
			value = 0;
		}
		if(0<changePerDay) {
			value = seconds*changePerDay/24/60/60;
		}
		value = parseInt(value);

		if(value>1000) {
			value = value.toString();
			value = value.substr(0,value.length-3)+'.'+value.substr(-3);
		}
		return value+' '+unit;
	}

	function euroValueFormatter(startValue,changePerDay,unit,seconds)
	{
		var value = startValue;
		if(0<changePerDay) {
			value = seconds*changePerDay/24/60/60;
		}

		if(value<1000) {
			value = parseInt(value*100);
			value = value.toString();
			while(value.length<3) {
				value = '0'+value;
			}
			value = value.substr(0,value.length-2)+','+value.substr(-2);
		} else {
			value = parseInt(value).toString();
			if(value.length>3) {
				value = value.substr(0,value.length-3)+'.'+value.substr(-3);
			}
			if(value.length>11) {
				value = parseInt(parseInt(value.substr(0,value.length-4))/1000000);
				value = value.toString();
				value = value+' Mrd ';
			} else if(value.length>10) {
				value = parseInt(parseInt(value.substr(0,value.length-4))/100000);
				value = value.toString();
				value = value.substr(0,value.length-1)+','+value.substr(-1)+' Mrd ';
			} else if(value.length>8) {
				value = parseInt(parseInt(value.substr(0,value.length-4))/1000);
				value = value.toString();
				value = value+' Mio ';
			} else if(value.length>7) {
				value = parseInt(parseInt(value.substr(0,value.length-4))/100);
				value = value.toString();
				value = value.substr(0,value.length-1)+','+value.substr(-1)+' Mio ';
			}
		}
		return value+' '+unit;
	}

	function createCard(data)
	{
		data = data || {};
		data.front = data.front || {};
		data.front.textTop = data.front.textTop || '';
		data.front.textButton = data.front.textButton || '';
		data.front.value = data.front.value || '';
		data.front.unit = data.front.unit || '';
		data.front.changePerDay = data.front.changePerDay || '';
		data.front.format = data.front.format || '';
		data.front.background = data.front.background || '';
		data.front.color = data.front.color || '';
		data.front.cssClass = data.front.cssClass || '';
		data.back = data.back || {};
		data.back.text = data.back.text || '';
		data.back.color = data.back.color || '';
		data.back.background = data.back.background || '';
		data.back.cssClass = data.back.cssClass || '';

		var value = data.front.value+' '+data.front.unit;
		var valueFormatter = stringValueFormatter;
		if('date'==data.front.format) {
			var d1 = new Date();
			var d2 = new Date(data.front.value);
			var diff = (d2-d1)/1000/60/60/24;
			if(diff<1) {
				value = '- Tage';
			} else if(diff<2) {
				value = '1 Tag';
			} else {
				value = parseInt(diff)+' Tage';
			}
		} else if('euro'==data.front.format) {
			valueFormatter = euroValueFormatter;
			value = valueFormatter(data.front.value,0,data.front.unit,0);
		} else if('int'==data.front.format) {
			valueFormatter = intValueFormatter;
			value = valueFormatter(data.front.value,0,data.front.unit,0);
		}
		var front = data.front.textTop+'<br><span>'+value+'</span><br>'+data.front.textButton;
		var frontTextColor = 'color:'+data.front.color+';';
		var frontBGImage = data.front.background;
		var frontCSSClass = data.front.cssClass;
		var back = data.back.text;
		var backTextColor = 'color:'+data.back.color+';';
		var backBGImage = data.back.background;
		var backCSSClass = data.back.cssClass;
		var changePerDay = data.front.changePerDay;

		createNewCard({
			front:{text:front,image:frontBGImage,style:frontTextColor,css:frontCSSClass+' display'},
			back:{text:back,image:backBGImage,style:backTextColor,css:backCSSClass},
			data:{value:data.front.value,unit:data.front.unit,change:changePerDay,formatter:valueFormatter},
		});
	}

	if(config.loaded < config.cards.length) {
		var url = config.cards[config.loaded];
{'fraction_non_alphanumeric': 0.1952059161035318, 'fraction_numerical': 0.02307790386331761, 'mean_word_length': 3.6414201183431953, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 22, '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': '5343432', 'n_tokens_mistral': 3099, 'n_tokens_neox': 2722, 'n_words': 387}