", $string);
$string = str_replace("</i>", "", $string);
$string = str_replace("<b>", "", $string);
$string = str_replace("</b>", "", $string);
$string = str_replace("<br>", "
", $string);
$string = str_replace("%%br%%", "
", $string);
return $string;
}
function _formatFloat($float, $size = 2) {
#return number_format($float, $size, ",", ".");
return number_format($float, $size);
}
function formatFloat($f) {
if ( 0 == ($f - floor($f))) {
$f = intval($f);
} else {
$f = _formatFloat($f);
}
return $f;
}
/**
* Shorter alias to formatFloat().
*/
function fF($f) {
return formatFloat($f);
}
function printScoreData($score_array) {
$return = "[";
foreach($score_array as $score) {
try {
$f_score = formatFloat($score);
} catch( Exception $e ) {
error_log("printScoreData: score data seems to be messed up: " . $e->getMessage());
$f_score = 0;
}
if ( 0 != $f_score ) {
$return .= $f_score;
} else {
$return .= "null";
}
$return .= ",";
}
rtrim($return, ",");
$return .= "]";
return $return;
}