", $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 { $return .= formatFloat($score); } catch( Exception $e ) { error_log("printScoreData: score data seems to be messed up: " . $e->getMessage()); $return .= 0; } $return .= ","; } rtrim($return, ","); $return .= "]"; return $return; }